text:
import express from 'express';
import bodyParser from 'body-parser';
import logger from 'morgan';
import dotenv from 'dotenv';
import path from 'path';
import cors from 'cors';
import http from 'http';
import group from './routes/group';
import user from './routes/user';
import general from './routes/general';
import models from './models';
import socketServer from './socketServer';

dotenv.config();
const app = express();

// Link app to socket io
const httpServer = http.createServer(app);
socketServer(httpServer, app);

// Middlewares
// Cross Origin Resource Sharing
app.use(cors());

app.use(logger('dev'));
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));

const indexPath = path.join(__dirname, '../client/index.html');
const publicPath = express.static(path.join(__dirname, '../client'));

app.use(publicPath);

// Load landing page
app.get('/', (req, res) => { res.sendFile(indexPath); });

// Authentication/User routes
app.use('/api/user', user);

// Group routes
app.use('/api/group', group);

// General API Requests
app.use('/api', general);
// Give sensible response for random routes
app.use('/*', (req, res) => {
  res.status(404).send({ message: 'Api up and running. Check documentation for appropriate routes' });
});
const port = process.env.PORT || 8002;

models.sequelize.sync();
const server = httpServer.listen(port);

// Export server for use in unit tests
export default server;

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="utf-8"?>
<layout xmlns:android="http://schemas.android.com/apk/res/android">

<LinearLayout
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="match_parent">

    <View
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="2"/>

    <ImageView
        android:id="@+id/plusSignImg"
        android:layout_width="match_parent"
        android:layout_height="120dp"
        android:src="@drawable/location_pin_curvy_flat"
        android:layout_weight="1"
        />

    <View
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight=".5"/>

    <TextView
        android:id="@+id/clickToAddModuleTxt"
        android:text="Tap to verify your location"
        android:textAlignment="center"
        android:layout_weight="1"
        android:textSize="@dimen/txt_location_verify_fragment_des"
        android:textColor="@color/colorTxtFragmentMain"
        android:layout_width="match_parent"
        android:layout_height="0dp"/>

    <View
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="2"/>

</LinearLayout>
</layout>


text:
This repository is for the Pirate Fleet app for Udacity's Beginning iOS App Development.

###Maintainers

@jarrodparkes

###How To Contribute

- Fork the repository to your personal account
- Make your changes
- Submit a pull request to this repository

###Description

Pirate Fleet is a Battleship clone with a small twist! There are mines!


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
null

#### Original name
Coprinus pseudoplicatus Copel.

### Remarks
null


text:
package fr.dgrandemange.cbcom.session.service;

import fr.dgrandemange.cbcom.exception.CBCOMSessionException;

/**
 * Channel callback interface
 *
 * @author dgrandemange
 *
 */
public interface IChannelCallback {

	/**
	 * This callback method should close the channel an ensure it is closed
	 */
	void close() throws CBCOMSessionException;

	/**
	 * Send some data over channel
	 *
	 * @param bIpdu
	 * @param doCount
	 * @throws CBCOMSessionException
	 */
	void send(byte[] bIpdu, boolean doCount) throws CBCOMSessionException;

	/**
	 * @param msg
	 */
	void log(String tag, Object msg);
}


text:
// ======================================================================
/*!
 * \file NFmiQueryDataUtil.h
 * \brief Interface of class NFmiQueryDataUtil
 */
// ======================================================================

#pragma once

#include "NFmiArea.h"
#include "NFmiDataIdent.h"
#include "NFmiDataMatrix.h"
#include "NFmiDef.h"
#include "NFmiGlobals.h"
#include "NFmiGrid.h"
#include "NFmiLevel.h"
#include "NFmiMetTime.h"
#include <boost/shared_ptr.hpp>

#ifndef BOOST_DISABLE_THREADS

#ifdef _MSC_VER
#pragma warning( \
    disable : 4244 4267 4512)  // boost:in thread kirjastosta tulee ikävästi 4244 varoituksia
#endif
#include <boost/thread.hpp>
#ifdef _MSC_VER
#pragma warning(default : 4244 4267 4512)  // laitetaan 4244 takaisin päälle, koska se on tärkeä
                                           // (esim. double -> int auto castaus varoitus)
#endif

#endif  // BOOST_DISABLE_THREADS

#include <set>
#include <string>
#include <vector>

class NFmiFastQueryInfo;
class NFmiQueryInfo;
class NFmiGrid;
class NFmiQueryData;
class NFmiTimeDescriptor;
class NFmiTimeBag;
class NFmiParamBag;
class NFmiPoint;
class NFmiString;
class NFmiRect;
class NFmiDataModifier;
class NFmiCalculationCondition;
class NFmiLocationBag;
class NFmiArea;
class NFmiLogger;

/*!
 * \class MyGrid
 * Tässä pari apu luokkaa useiden hilojen yhdistämistä varten.
 * En käyttänyt NFmiGrid-luokkaa, koska sillä ja sen emolla ei
 * ollut kopi-konstruktoria ei sijoitus operaattoreita (enkä jaksanut tehdä).
 * Käytetään apuna mm. kun grib:eistä tehdään qdataa ja kun yhdistellään
 * monista qdatoista yksi uusi qdata.
 */
class MyGrid
{
 public:
  MyGrid() : itsArea(0), itsNX(0), itsNY(0) {}
  MyGrid(const NFmiArea *theArea, int theNX, int theNY)
      : itsArea(theArea ? theArea->Clone() : 0), itsNX(theNX), itsNY(theNY)
  {
  }

  MyGrid(const MyGrid &theGrid)
      : itsArea(theGrid.itsArea ? theGrid.itsArea->Clone() : 0),
        itsNX(theGrid.itsNX),
        itsNY(theGrid.itsNY)
  {
  }

  MyGrid(const NFmiGrid &theGrid)
      : itsArea(theGrid.Area() ? theGrid.Area()->Clone() : 0),
        itsNX(theGrid.XNumber()),
        itsNY(theGrid.YNumber())
  {
  }

  ~MyGrid() { delete itsArea; }
  MyGrid &operator=(const MyGrid &theGrid)
  {
    if (this != &theGrid)
    {
      delete itsArea;
      itsArea = theGrid.itsArea ? theGrid.itsArea->Clone() : 0;
      itsNX = theGrid.itsNX;
      itsNY = theGrid.itsNY;
    }
    return *this;
  }

  MyGrid &operator=(const NFmiGrid &theGrid)
  {
    delete itsArea;
    itsArea = theGrid.Area() ? theGrid.Area()->Clone() : 0;
    itsNX = theGrid.XNumber();
    itsNY = theGrid.YNumber();
    return *this;
  }
  bool operator==(const MyGrid &theGrid)
  {
    if (itsNX == theGrid.itsNX)
      if (itsNY == theGrid.itsNY)
      {
        if (itsArea == 0 && theGrid.itsArea == 0)
          return true;
        else if (itsArea && theGrid.itsArea)
        {
          if (itsArea->ClassId() == theGrid.itsArea->ClassId())
            if (*itsArea == *(theGrid.itsArea))
              return true;
        }
      }
    return false;
  }

  bool operator<(const MyGrid &theGrid) const;

  bool operator==(const NFmiGrid &theGrid)
  {
    MyGrid tmpGrid(theGrid);
    return (*this == tmpGrid);
  }

  // private:
  NFmiArea *itsArea;
  unsigned long itsNX;
  unsigned long itsNY;
};

struct CombinedParamStruct
{  // tämä structi piti tehdä, että sain vähennettyä boost::in Thread:ille annettujen parametrin
  // määrää (max 9 parametria)
  CombinedParamStruct() : weather1(false), weather2(false), wind1(false), wind2(false), wind3(false)
  {
  }

  bool weather1;  // tehdään weatherandcloudiness seuraavista: kFmiWeatherSymbol1,
                  // kFmiTotalCloudCover, kFmiCloudSymbol ja kFmiFogSymbol
  bool weather2;  // tehdään weatherandcloudiness seuraavista: kFmiWeatherSymbol3
  bool wind1;     // tehdään totalwind seuraavista: kFmiWindVectorMS
  bool wind2;     // tehdään totalwind seuraavista: kFmiWindDirection ja kFmiWindSpeedMS
  bool wind3;     // tehdään totalwind seuraavista: kFmiWindUMS ja kFmiWindVMS
};

static const NFmiRect gMissingCropRect(kFloatMissing, kFloatMissing, kFloatMissing, kFloatMissing);

// Tähän rakenteeseen saadaan kaikki tieto mistä tahansa hilasta, että
// voidaan tehdä yhdistelyjä.
// Käytetään apuna mm. kun grib:eistä tehdään qdataa ja kun yhdistellään
// monista qdatoista yksi uusi qdata.
struct GridRecordData
{
  GridRecordData();
  void ChangeParam(const NFmiParam &theWantedParam);

  NFmiMetTime itsOrigTime;
  NFmiMetTime itsValidTime;
  NFmiDataIdent itsParam;
  NFmiLevel itsLevel;
  MyGrid itsOrigGrid;  // tämä on datan originaali gridi
  MyGrid itsGrid;  // tämä on haluttu datan gridi, joka yleensa sama kuin orig, mutta jos on haluttu
                   // cropata dataa, tässä croppi hila
  bool fDoProjectionConversion;
  NFmiDataMatrix<float> itsGridData;
  NFmiRect itsLatlonCropRect;        // tähän talletetaan mahdollinen croppi recti
  NFmiPoint itsGridPointCropOffset;  // tähän talletetaan mahdollinen cropin offset originaali
                                     // gridin hila yksikössä
  double itsMissingValue;
  bool fParamChanged;
  NFmiParam itsOrigParam;
};

class NFmiStopFunctor
{
 public:
  NFmiStopFunctor() : fStop(false) {}
  ~NFmiStopFunctor() {}
  bool Stop() const { return fStop; }
  void Stop(bool newValue) { fStop = newValue; }

 private:
  bool fStop;
};

class NFmiOperationProgress
{
 public:
  virtual ~NFmiOperationProgress() {}
  virtual void StepIt() = 0;
  virtual void SetRange(int low, int high, int stepCount) = 0;
  virtual void AddRange(int value) = 0;
  virtual bool DoPostMessage(unsigned int message, unsigned int wParam = 0, long lParam = 0) = 0;
  virtual bool WaitUntilInitialized() = 0;
};

class NFmiThreadCallBacks
{
 public:
  NFmiThreadCallBacks(NFmiStopFunctor *theStopper = 0, NFmiOperationProgress *theProgress = 0)
      : itsStopper(theStopper), itsProgress(theProgress)
  {
  }

  bool Stop() const;
  void Stop(bool newValue);
  void StepIt();
  void SetRange(int low, int high, int stepCount);
  void AddRange(int value);
  bool DoPostMessage(unsigned int message, unsigned int wParam = 0, long lParam = 0);
  void CheckIfStopped();  // heittää poikkeuksen, jos lopetetaan
  bool WaitUntilInitialized();

 private:
  NFmiStopFunctor *itsStopper;
  NFmiOperationProgress *itsProgress;
};

class NFmiStopThreadException
{
 public:
  NFmiStopThreadException() {}
  ~NFmiStopThreadException() {}
};

// Tämä luokka laskee worker-threadi parvelle aina kulloisenkin 'vapaan' laskettavan timeIndeksin.
// Tältä siis pyydetään seuraav työstettävä aika-indeksi mm.
// FillSingleTimeGridDataInThread-funktiossa.
class NFmiTimeIndexCalculator
{
 public:
  typedef boost::shared_mutex MutexType;
  typedef boost::shared_lock<MutexType>
      ReadLock;  // Read-lockia ei oikeasti tarvita, mutta laitan sen tähän, jos joskus tarvitaankin
  typedef boost::unique_lock<MutexType> WriteLock;

  NFmiTimeIndexCalculator(unsigned long theTimeSize);
  NFmiTimeIndexCalculator(unsigned long theStartTimeIndex, unsigned long theEndTimeIndex);
  bool GetCurrentTimeIndex(unsigned long &theTimeIndexOut);

 private:
  unsigned long itsStartTimeIndex;
  unsigned long itsEndTimeIndex;
  unsigned long itsCurrentTimeIndex;
  MutexType itsMutex;
  bool fNoMoreWork;

  NFmiTimeIndexCalculator(const NFmiTimeIndexCalculator &);  // ei toteuteta kopio konstruktoria
  NFmiTimeIndexCalculator &operator=(
      NFmiTimeIndexCalculator const &);  // ei toteuteta sijoitus operaattoria
};

// Tämä luokka laskee worker-threadi parvelle aina sopivan locationIndex-välin laskettavaksi.
// Idea on siis se että hila laskut jaetaan sopivan mittäisiin pätkiin esim. 50 pituisiin
// ja kukin worker threadi aina vuorollaan kysisi, minkä pätkän nyt voisi tehdä.
class NFmiLocationIndexRangeCalculator
{
 public:
  typedef boost::shared_mutex MutexType;
  typedef boost::shared_lock<MutexType>
      ReadLock;  // Read-lockia ei oikeasti tarvita, mutta laitan sen tähän, jos joskus tarvitaankin
  typedef boost::unique_lock<MutexType> WriteLock;

  NFmiLocationIndexRangeCalculator(unsigned long theLocationSize, unsigned long theChunkSize);
  NFmiLocationIndexRangeCalculator(unsigned long theStartLocationIndex,
                                   unsigned long theEndLocationIndex,
                                   unsigned long theChunkSize);

  bool GetCurrentLocationRange(unsigned long &theStartIndexOut, unsigned long &theEndIndexOut);

 private:
  unsigned long itsStartLocationIndex;
  unsigned long itsEndLocationIndex;
  unsigned long itsCurrentLocationIndex;
  unsigned long itsChunkSize;
  MutexType itsMutex;
  bool fNoMoreWork;

  // ei toteuteta kopio konstruktoria
  NFmiLocationIndexRangeCalculator(const NFmiLocationIndexRangeCalculator &);
  // ei toteuteta sijoitus operaattoria
  NFmiLocationIndexRangeCalculator &operator=(NFmiLocationIndexRangeCalculator const &);
};

//! Undocumented
class NFmiQueryDataUtil
{
 public:
  typedef std::vector<GridRecordData *> GridDataVector;
  using SoundingLevelContainer = std::vector<unsigned long>;
  using SignificantSoundingLevels = std::unique_ptr<SoundingLevelContainer>;
  static SignificantSoundingLevels GetSignificantSoundingLevelIndices(NFmiFastQueryInfo &theInfo);

  static void DestroyGridRecordData(GridDataVector &theGridRecordDatas);  // apufunktio, joka tuhoaa
                                                                          // dynaamisen datan ja
                                                                          // tyhjentää vektorin

  /*!
   *  \class LimitChecker
   *  Tarkistaa ettei jokin laskettu arvo mene yli alle säädettyjen rajojen.
   *  Tarpeen mm. Lagrange interpoloinnissa, jossa voi syntyä uusia minimi ja maksimi
   *  arvoja. Tällöin esim. tuulen suunnaksi voi tulla negatiivinen arvo tai yli 360 astetta.
   *  Halutessa myös pyöräyttää ympäri eli jos arvoksi olisi tuulen suunnalle tulossa
   *  370, osaa laittaa arvoksi 10 eikä leikkaa 360:een. Jos taas kyseessä vaikka
   *  kosteusprosentti, pitää yli sadan mene arvo leikata 100:n.
   */
  class LimitChecker
  {
   public:
    LimitChecker(float theLowerLimit, float theUpperLimit, bool theCircularValue = false);
    float GetInsideLimitsValue(float theValue) const;

    inline float LowerLimit() const { return itsLowerLimit; }
    inline void LowerLimit(float newValue)
    {
      itsLowerLimit = newValue;
      Update();
    }
    inline float UpperLimit() const { return itsUpperLimit; }
    inline void UpperLimit(float newValue)
    {
      itsUpperLimit = newValue;
      Update();
    }
    inline bool CircularValue() const { return fCircularValue; }
    inline void CircularValue(bool newValue)
    {
      fCircularValue = newValue;
      Update();
    }

   private:
    void Update();

    float itsLowerLimit;
    float itsUpperLimit;
    bool fCircularValue;       // esim tuulen suunta menee ympäri rajojen
    float itsLimitDifference;  // ympyrä laskuja varten
  };                           // class LimitChecker

 public:
  static void CheckIfStopped(NFmiStopFunctor *theStopFunctor);
  static void CheckIfStopped(NFmiThreadCallBacks *theThreadCallBacks);
  static void DoStepIt(NFmiThreadCallBacks *theThreadCallBacks);
  static void SetRange(NFmiThreadCallBacks *theThreadCallBacks, int low, int high, int stepCount);
  static void AddRange(NFmiThreadCallBacks *theThreadCallBacks, int value);

  template <typename T>
  static bool IsEqualEnough(T value1, T value2, T usedEpsilon)
  {
    if (::fabs(static_cast<double>(value1 - value2)) < usedEpsilon)
      return true;
    return false;
  }

  static NFmiQueryData *ReadNewestData(const std::string &theFileFilter);
  static bool AreAreasEqual(const NFmiArea *theArea1, const NFmiArea *theArea2);
  static bool AreGridsEqual(const NFmiGrid *theGrid1, const NFmiGrid *theGrid2);
  static bool AreAreasSameKind(const NFmiArea *theArea1, const NFmiArea *theArea2);

  static NFmiQueryData *GridQD2NewGridQD(NFmiQueryData *theSourceData,
                                         NFmiGrid *theWantedGridFormat);

  static NFmiQueryData *ExtractParams(NFmiQueryData *theSourceData,
                                      const NFmiParamBag &theWantedParams);

  static NFmiQueryData *ExtractLocations(NFmiQueryData *theSourceData,
                                         const NFmiLocationBag &theWantedLocations,
                                         FmiInterpolationMethod theInterpolationMethod);

  static NFmiQueryData *CombineParams(NFmiQueryData *theSourceData1, NFmiQueryData *theSourceData2);

  static NFmiQueryData *CombineLocations(NFmiQueryData *theSourceData1,
                                         NFmiQueryData *theSourceData2,
                                         int thePriorisedDataNumber);

  static NFmiQueryData *Interpolate2OtherGrid(NFmiQueryData *theSourceData,
                                              const NFmiGrid *theWantedGrid,
                                              NFmiLogger *theLogger = 0);

  static NFmiQueryData *Interpolate2OtherGrid(NFmiQueryData *theSourceData,
                                              const NFmiGrid *theWantedGrid,
                                              NFmiLogger *theLogger,
                                              int theMaxThreadCount);

  static void FillGridData(NFmiQueryData *theSource,
                           NFmiQueryData *theTarget,
                           unsigned long theStartTimeIndex = gMissingIndex,
                           unsigned long theEndTimeIndex = gMissingIndex,
                           NFmiLogger *theLogger = 0,
                           bool fUseOnlyOneThread = true);

  static void FillGridDataFullMT(NFmiQueryData *theSource,
                                 NFmiQueryData *theTarget,
                                 unsigned long theStartTimeIndex = gMissingIndex,
                                 unsigned long theEndTimeIndex = gMissingIndex,
                                 unsigned int usedThreadCount = 0,
                                 NFmiLogger *theDebugLogger = 0);

  static NFmiQueryData *ExtractTimes(const NFmiQueryData *theSourceData,
                                     const NFmiTimeDescriptor &theWantedTimeDesc);

  static NFmiQueryData *InterpolateTimes(NFmiQueryData *theSourceData,
                                         int theTimeResolutionInMinutes,
                                         int theStartTimeResolutionInMinutes,
                                         NFmiTimeBag *thePossibleReferenceTimeBag = 0,
                                         int theMaxTimeSearchRangeInMinutes = 360,
                                         FmiInterpolationMethod theInterpolationMethod = kLinearly);

  static NFmiQueryData *Area1QDOverArea2QD(NFmiQueryData *areaData1, NFmiQueryData *areaData2);

  static NFmiTimeDescriptor NewTimeDescriptor(NFmiQueryData *theSourceData,
                                              int theTimeResolutionInMinutes);

  //! Aikaresoluution pitää olla sama
  static bool OverWriteTimesFromFile(NFmiFastQueryInfo &theLongerInfo,
                                     NFmiFastQueryInfo &theShorterInfo);

  static NFmiQueryData *SpaceOutData(NFmiFastQueryInfo &theSourceInfo,
                                     const NFmiPoint &newGridSize,
                                     NFmiDataModifier *theModifier,
                                     int theModifierId,
                                     double theAreaFactor,
                                     double theRange,
                                     const NFmiRect &theDataGatheringRange,
                                     const NFmiCalculationCondition &theMaskCondition);

  static NFmiQueryData *CombineTimes(NFmiFastQueryInfo &theSourceInfo1,
                                     NFmiFastQueryInfo &theSourceInfo2,
                                     int theMaxTimeBagSizeInNewData,
                                     int theStartTimeFunction,
                                     int theEndTimeFunction,
                                     int theOriginTimeFunction,
                                     bool fMakeChangingTimeResolution);

  static NFmiQueryData *CombineTimes(std::vector<std::string> &theFileNames,
                                     int theMaxTimesInNewData);

  static NFmiQueryData *MakeCombineParams(NFmiFastQueryInfo &theSourceInfo,
                                          double theWantedInfoVersion,
                                          bool fKeepCloudSymbolParameter,
                                          bool fDoTotalWind,
                                          bool fDoWeatherAndCloudiness,
                                          FmiParameterName theWindGustParId,
                                          bool fAllowLessParamsWhenCreatingWeather,
                                          int theMaxUsedThreadCount,
                                          bool fDoaccuratePrecip,
                                          bool fForceTimeBag = false);

  static NFmiQueryData *MakeCombineParams(NFmiFastQueryInfo &theSourceInfo,
                                          double theWantedInfoVersion,
                                          bool fKeepCloudSymbolParameter,
                                          bool fDoTotalWind,
                                          bool fDoWeatherAndCloudiness,
                                          FmiParameterName theWindGustParId,
                                          const std::vector<int> &thePrecipFormParIds,
                                          bool fAllowLessParamsWhenCreatingWeather,
                                          int theMaxUsedThreadCount,
                                          bool fDoaccuratePrecip,
                                          bool fForceTimeBag = false);

  static NFmiQueryData *MakeCombineParams(NFmiFastQueryInfo &theSourceInfo,
                                          double theWantedInfoVersion,
                                          bool fKeepCloudSymbolParameter,
                                          bool fDoTotalWind,
                                          bool fDoWeatherAndCloudiness,
                                          FmiParameterName theWindGustParId,
                                          const std::vector<int> &thePrecipFormParIds,
                                          const std::vector<int> &theFogParIds,
                                          const std::vector<int> &thePotParIds,
                                          bool fAllowLessParamsWhenCreatingWeather,
                                          int theMaxUsedThreadCount,
                                          bool fDoaccuratePrecip,
                                          bool fForceTimeBag = false);

  static NFmiQueryData *CreateEmptyData(NFmiQueryInfo &srcInfo);
  static NFmiQueryData *CreateEmptyData(NFmiQueryInfo &srcInfo,
                                        const std::string &theFilename,
                                        bool fInitialize);

  //@{ \name datan konversiot 6:sta 7:aan tai päinvastoin -funktiot
  static NFmiQueryData *FqdV6ToV7(NFmiFastQueryInfo &theSourceInfo);
  static NFmiQueryData *FqdV7ToV6(NFmiFastQueryInfo &theSourceInfo);
  //@}

  static NFmiQueryData *DoTimeFiltering(NFmiQueryData *theSourceData,
                                        int theFilterId,
                                        int theTimeOffsetStartInMinutes,
                                        int theTimeOffsetEndInMinutes,
                                        double theAdditionalParam1 = 1,
                                        double theAdditionalParam2 = 1);

  static NFmiQueryData *DoAreaFiltering(NFmiQueryData *theSourceData,
                                        int theFilterId,
                                        int theAreaType,
                                        double theAdditionalParam1 = 1,
                                        double theAdditionalParam2 = 1);

  // ********************************************************************************
  // ***************  NowcastFilter osuus on nyt täällä!  ***************************
  // ********************************************************************************
  static bool DoNowCastFiltering(const NFmiString &theData1FileName,
                                 const NFmiString &theData2FileName,
                                 const NFmiString &theOutputFileName,
                                 int theTimeRangeForPureData);

  static NFmiQueryData *DoNowCastFiltering(NFmiFastQueryInfo &theInfo1,
                                           NFmiFastQueryInfo &theInfo2,
                                           int theTimeRangeForPureData);

  // ********************************************************************************
  // ***************  NowcastFilter osuus on nyt täällä!  ***************************
  // ********************************************************************************

  static const NFmiString &GetOfficialQueryDataProdIdsKey();

  static NFmiQueryData *QDCrop(
      NFmiFastQueryInfo &theInfo, int theLeft, int theTop, int theRight, int theBottom);

  static std::string GetFileFilterDirectory(const std::string &theFileFilter);
  static NFmiQueryData *CombineQueryDatas(
      bool fDoRebuild,
      boost::shared_ptr<NFmiQueryData> &theBaseQData,
      std::vector<boost::shared_ptr<NFmiQueryData>> &theQDataVector,
      bool fDoTimeStepCombine,
      int theMaxTimeStepsInData = 0,
      NFmiStopFunctor *theStopFunctor = 0);
  static NFmiQueryData *CombineQueryDatas(bool fDoRebuildCheck,
                                          const std::string &theBaseDataFileFilter,
                                          const std::string &theFileFilter,
                                          bool fDoTimeStepCombine,
                                          int theMaxTimeStepsInData = 0,
                                          NFmiStopFunctor *theStopFunctor = 0);
  static int CalcOptimalThreadCount(int maxAvailableThreads, int separateTaskCount);
  static std::vector<std::string> GetFileNamesForCombinationWork(const std::string &theFileFilter);
  static boost::shared_ptr<NFmiQueryData> GetNewestQueryData(const std::string &theFileFilter);
  static std::vector<boost::shared_ptr<NFmiQueryData>> ReadQueryDataFilesForCombinationWork(
      boost::shared_ptr<NFmiQueryData> theBaseQData,
      const std::string &theDirName,
      std::vector<std::string> &theFilesIn,
      NFmiStopFunctor *theStopFunctor,
      bool fDoRebuildCheck);
  static NFmiQueryData *CombineAcceptedTimeStepQueryData(
      bool fDoRebuild,
      boost::shared_ptr<NFmiQueryData> &theBaseQData,
      std::vector<boost::shared_ptr<NFmiQueryData>> &theQDataVector,
      const std::vector<NFmiMetTime> &theAcceptedTimes,
      NFmiStopFunctor *theStopFunctor = 0);
  static std::vector<NFmiMetTime> MakeValidTimesList(
      std::vector<boost::shared_ptr<NFmiFastQueryInfo>> &theFastInfoVector,
      int theMaxTimeStepsInData);
  static std::vector<boost::shared_ptr<NFmiFastQueryInfo>> MakeTotalFastInfoVector(
      std::vector<boost::shared_ptr<NFmiQueryData>> &theQDataVector,
      boost::shared_ptr<NFmiQueryData> &theBaseQData,
      bool fDoRebuild);

};  // class NFmiQueryDataUtil

// ======================================================================


text:
class Mesh{
public:
    void paint(bool fill=1)const;
    void paintNormals()const;

protected:
    vector<Face> face;
    vector<vtx_p> vertex;
};

#endif // MESH_H


text:
<?php

namespace im\search\components\service\db;

use im\eav\models\Value;
use im\search\components\index\Document;
use im\search\components\searchable\AttributeDescriptor;
use im\search\components\transformer\ObjectToDocumentTransformerInterface;
use yii\db\ActiveQuery;
use yii\helpers\ArrayHelper;

class ActiveRecordToDocumentTransformer implements ObjectToDocumentTransformerInterface
{
    /**
     * @var array
     */
    protected $options = [
        'identifier' => 'id'
    ];

    public function __construct(array $options = [])
    {
        $this->options = array_merge($this->options, $options);
    }

    /**
     * @inheritdoc
     */
    public function transform($object, $attributes)
    {
        $value = null;
        $identifier = $object->{$this->options['identifier']};
        $document = new Document($identifier);
        foreach ($attributes as $name => $attribute) {
            $toName = $attribute->name;
            if ($attribute->value) {
                if ($attribute->value instanceof \Closure) {
                    $value = call_user_func($attribute->value, $object, $attribute);
                } else {
                    $value = $attribute->value;
                }
            } else {
                $fromNameParts = explode('.', $name);
                $value = null;
                foreach ($fromNameParts as $key => $fromNamePart) {
                    if ($key === 0) {
                        $value = $object->$fromNamePart;
                    } elseif ($value !== null) {
                        if (is_array($value)) {
                            $newValue = [];
                            foreach ($value as $item) {
                                $newValue[] = is_object($item) ? $item->$fromNamePart : (is_array($item) ? $item[$fromNamePart] : $fromNamePart);
                            }
                            $value = $newValue;
                        } else {
                            $value = $value->$fromNamePart;
                        }
                    }
                }
                $toNameParts = explode('.', $toName);
                if (count($toNameParts) > 1) {
                    foreach (array_reverse($toNameParts) as $key => $toNamePart) {
                        if ($key === 0 && is_array($value)) {
                            $value = array_map(function ($item) use ($toNamePart) {
                                return [$toNamePart => $item];
                            }, $value);
                        } else {
                            $value = [$toNamePart => $value];
                        }
                    }
                    reset($value);
                    $toName = key($value);
                    $value = reset($value);
                }
            }
            if ($value instanceof Value) {
                $value = $value->value;
            } elseif ($value instanceof ActiveQuery) {
                //$value = $value->multiple ? $value->all() : $value->one();
                $value = null;
            }
            if ($value !== null) {
                if ($attribute->type) {
                    settype($value, $attribute->type);
                }
                if ($document->has($toName) && is_array($document->get($toName))) {
                    $document->set($toName, array_replace_recursive($document->get($toName), $value));
                } else {
                    $document->set($toName, $value);
                }
            }
        }

        return $this->postTransform($document, $object, $attributes);
    }

    /**
     * Post transformation operations.
     *
     * @param Document $document
     * @param object $object
     * @param AttributeDescriptor[] $attributes
     * @return Document
     */
    protected function postTransform(Document $document, $object, $attributes)
    {
        return $document;
    }
}


text:
using UnityEngine;
using System.Collections;

[RequireComponent ( typeof ( BoxCollider ) )]
public class PickerPopper : MonoBehaviour
{
	public GameObject pickerColliderObject;
	public IPPickerBase picker;
	public UIWidget pickerBackground;
	public UIPanel cyclerPanel;

	public Vector2 openCloseScaleTweenDuration = new Vector2 ( 1f, 1f );
	public Vector2 openCloseClippingTweenDuration = new Vector2 ( 1.2f, .8f );

	public UIWidget widgetForBlinkConfirmation;
	public Color blinkColor;
	public float confirmBlinkDuration;

	public GameObject notifyWhenCollapsing;
	public string	  message = "OnPickerCollapsed";

	IPDragScrollView	 	_dragContents;
	IPUserInteraction 		_pickerInteraction;
	IPCycler 				_cycler;
	TweenPanelClipRange 	_clipRangeTween;
	TweenPanelClipSoftness _softnessTween;
	TweenHeight 			_scaleTween;

	BoxCollider _pickerCollider,
				_thisCollider;

	bool 		_waitBeforeClosing,
				_clippingIsTweening;

	Color 		_initBlinkColor;

	Vector3 _cyclerCachedPos;

	void Start ()
	{
		if ( widgetForBlinkConfirmation != null )
		{
			_initBlinkColor = widgetForBlinkConfirmation.color;
		}

		_cycler = cyclerPanel.gameObject.GetComponent ( typeof ( IPCycler ) ) as IPCycler;

		_dragContents = pickerColliderObject.GetComponent ( typeof ( IPDragScrollView ) ) as IPDragScrollView;
		_pickerInteraction = pickerColliderObject.GetComponent ( typeof ( IPUserInteraction ) ) as IPUserInteraction;

		_pickerCollider = pickerColliderObject.GetComponent ( typeof ( BoxCollider ) ) as BoxCollider;
		_thisCollider = gameObject.GetComponent ( typeof ( BoxCollider ) ) as BoxCollider;

		_clipRangeTween = cyclerPanel.gameObject.GetComponent ( typeof ( TweenPanelClipRange ) ) as TweenPanelClipRange;
		_softnessTween = cyclerPanel.gameObject.GetComponent ( typeof ( TweenPanelClipSoftness ) ) as TweenPanelClipSoftness;

		_scaleTween = pickerBackground.gameObject.GetComponent ( typeof ( TweenHeight ) ) as TweenHeight;

		cyclerPanel.baseClipRegion = _clipRangeTween.from;
		cyclerPanel.clipSoftness = _softnessTween.from;
		pickerBackground.height = ( int )_scaleTween.from;

		_dragContents.enabled = false;
		_pickerCollider.enabled = false;
	}

	public IEnumerator OpenPicker ()
	{
		_thisCollider.enabled = false;
		_scaleTween.duration = openCloseScaleTweenDuration.x;
		_scaleTween.Play ( true );

		EventDelegate.Set ( _clipRangeTween.onFinished, OnTweenClipRangeFinished );

		_clippingIsTweening = true;
		_clipRangeTween.duration = openCloseClippingTweenDuration.x;
		_clipRangeTween.Play ( true );

		if ( _softnessTween != null )
		{
			_softnessTween.duration = openCloseClippingTweenDuration.x;
			_softnessTween.Play ( true );
		}

		while ( _clippingIsTweening )
			yield return null;

		_dragContents.enabled = true;
		_pickerCollider.enabled = true;
		_pickerInteraction.onPickerClicked += PickerClicked;
		_cycler.onCyclerSelectionStarted += OnPickerSelectionStarted;
		_cycler.onCyclerStopped += OnPickerStopped;
	}

	public IEnumerator ClosePicker ()
	{
		_pickerCollider.enabled = false;
		_dragContents.enabled = false;
		_pickerInteraction.onPickerClicked -= PickerClicked;

		if ( widgetForBlinkConfirmation != null )
		{
			StartCoroutine ( BlinkWidget ( 2 ) );
		}

		yield return null;

		if ( _cycler.transform.localPosition == _cyclerCachedPos )
			_waitBeforeClosing = false;

		while ( _waitBeforeClosing )
		{
			yield return null;
			//Debug.Log ("waiting");
		}

		picker.ResetPicker ();

		_cycler.onCyclerSelectionStarted -= OnPickerSelectionStarted;
		_cycler.onCyclerStopped -= OnPickerStopped;

		_thisCollider.enabled = true;

		_scaleTween.duration = openCloseScaleTweenDuration.y;

		_scaleTween.Play ( false );
		_clipRangeTween.duration = openCloseClippingTweenDuration.y;
		_clipRangeTween.Play ( false );

		if ( _softnessTween != null )
		{
			_softnessTween.duration = openCloseClippingTweenDuration.y;
			_softnessTween.Play ( false );
		}
	}

	void OnClick ()
	{
		StartCoroutine ( OpenPicker () );
	}

	void PickerClicked ()
	{
		StartCoroutine ( ClosePicker() );

		if ( notifyWhenCollapsing != null )
			notifyWhenCollapsing.SendMessage ( message );
	}

	void OnPickerSelectionStarted ()
	{
		_cyclerCachedPos = _cycler.transform.localPosition;
		_waitBeforeClosing = true;
	}

	void OnPickerStopped ()
	{
		_waitBeforeClosing = false;
	}

	void OnTweenClipRangeFinished ()
	{
		_clippingIsTweening = false;
	}

	IEnumerator BlinkWidget( int nbOfBlinks )
	{
		for ( int i = 0; i < nbOfBlinks; i++ )
		{
			yield return StartCoroutine ( LerpBackgroundColor ( blinkColor, confirmBlinkDuration / 2 ) );
			yield return StartCoroutine ( LerpBackgroundColor ( _initBlinkColor, confirmBlinkDuration / 2 ) );
		}
	}

	IEnumerator LerpBackgroundColor ( Color targetColor, float duration )
	{
		Color initValue = widgetForBlinkConfirmation.color;
		float i = 0f;

		float rate = 1f / ( duration );

		while ( i < 1f )
		{
			i += Time.deltaTime * rate;
			widgetForBlinkConfirmation.color = Color.Lerp ( initValue, targetColor, i );
			yield return null;
		}
	}
}


text:
package com.anysoftkeyboard.languagepack.esperanto;

import com.anysoftkeyboard.addon.PackBroadcastReceiverBase;

public class PackBroadcastReceiver extends PackBroadcastReceiverBase {}


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 4.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
		<title>jVitela 2.0</title>
		<link rel="stylesheet" href="http://code.jquery.com/ui/jquery-ui-git.css">
		<link type="text/css" href="../../themes/base/jquery.uix.list.css" rel="stylesheet"/>

null

one

two

three

four

five

six

seven

eight

nine

then

Demo description.


text:
use std::time::Duration;

use clap::{App, Arg};
use log::info;

use rdkafka::config::ClientConfig;
use rdkafka::message::{Header, OwnedHeaders};
use rdkafka::producer::{FutureProducer, FutureRecord};
use rdkafka::util::get_rdkafka_version;

use crate::example_utils::setup_logger;

mod example_utils;

async fn produce(brokers: &str, topic_name: &str) {
    let producer: &FutureProducer = &ClientConfig::new()
        .set("bootstrap.servers", brokers)
        .set("message.timeout.ms", "5000")
        .create()
        .expect("Producer creation error");

    // This loop is non blocking: all messages will be sent one after the other, without waiting
    // for the results.
    let futures = (0..5)
        .map(|i| async move {
            // The send operation on the topic returns a future, which will be
            // completed once the result or failure from Kafka is received.
            let delivery_status = producer
                .send(
                    FutureRecord::to(topic_name)
                        .payload(&format!("Message {}", i))
                        .key(&format!("Key {}", i))
                        .headers(OwnedHeaders::new().insert(Header {
                            key: "header_key",
                            value: Some("header_value"),
                        })),
                    Duration::from_secs(0),
                )
                .await;

            // This will be executed when the result is received.
            info!("Delivery status for message {} received", i);
            delivery_status
        })
        .collect::<Vec<_>>();

    // This loop will wait until all delivery statuses have been received.
    for future in futures {
        info!("Future completed. Result: {:?}", future.await);
    }
}

#[tokio::main]
async fn main() {
    let matches = App::new("producer example")
        .version(option_env!("CARGO_PKG_VERSION").unwrap_or(""))
        .about("Simple command line producer")
        .arg(
            Arg::with_name("brokers")
                .short("b")
                .long("brokers")
                .help("Broker list in kafka format")
                .takes_value(true)
                .default_value("localhost:9092"),
        )
        .arg(
            Arg::with_name("log-conf")
                .long("log-conf")
                .help("Configure the logging format (example: 'rdkafka=trace')")
                .takes_value(true),
        )
        .arg(
            Arg::with_name("topic")
                .short("t")
                .long("topic")
                .help("Destination topic")
                .takes_value(true)
                .required(true),
        )
        .get_matches();

    setup_logger(true, matches.value_of("log-conf"));

    let (version_n, version_s) = get_rdkafka_version();
    info!("rd_kafka_version: 0x{:08x}, {}", version_n, version_s);

    let topic = matches.value_of("topic").unwrap();
    let brokers = matches.value_of("brokers").unwrap();

    produce(brokers, topic).await;
}


text:
<!DOCTYPE html>

    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
    <meta charset="utf-8">
    <meta content="width=device-width" name="viewport">
    <link href="/static/style.css" rel="stylesheet">
    <title>Keytar</title>

Keytar

Waiting for test results...


text:
/*
   Plupload
------------------------------------------------------------------- */

.plupload_button {
	display: -moz-inline-box; /* FF < 3*/
	display: inline-block;
	font: normal 12px sans-serif;
	text-decoration: none;
    color: #636363;
    border: 1px solid #d2d2d2;
    height: 30px;
    font-size: 11px;
    line-height: 30px;
    padding: 0 8px;
	margin-right: 4px;
    background: #f8f8f8;
    background: -moz-linear-gradient(top, #f8f8f8 0%, #eaeaea 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#eaeaea));
    background: -webkit-linear-gradient(top, #f8f8f8 0%,#eaeaea 100%);
    background: -o-linear-gradient(top, #f8f8f8 0%,#eaeaea 100%);
    background: -ms-linear-gradient(top, #f8f8f8 0%,#eaeaea 100%);
    background: linear-gradient(to bottom, #f8f8f8 0%,#eaeaea 100%);
    filter: -webkit-linear-gradient(top, #f8f8f8 0%,#eaeaea 100%);
	outline: 0;

    /* Optional rounded corners for browsers that support it */
    -moz-border-radius: 0px;
    -khtml-border-radius: 0px;
    -webkit-border-radius: 0px;
    border-radius: 0px;
}

.plupload_button:hover {
	color: #000;
	text-decoration: none;
}

.plupload_disabled, a.plupload_disabled:hover {
    color: #737373;
    border-color: #c5c5c5;
    background: #ededed;
	cursor: default;
}

.plupload_add {
	background-position: -181px center;
}

.plupload_wrapper {
	font: normal 11px Verdana,sans-serif;
	width: 100%;
}

.plupload_container {
	/*-moz-border-radius: 5px;*/
}

.plupload_container input {
	border: 1px solid #DDD;
	font: normal 11px Verdana,sans-serif;
	width: 98%;
}

.plupload_header {background: #f8f8f8 repeat-x; display: none;}
.plupload_header_content {
	min-height: 56px;
	padding-left: 60px;
	color: #FFF;
}
.plupload_header_title {
	font: normal 18px sans-serif;
	padding: 6px 0 3px;
}
.plupload_header_text {
	font: normal 12px sans-serif;
}

.plupload_filelist {
	margin: 0;
	padding: 0;
	list-style: none;
}

.plupload_scroll .plupload_filelist {
	height: 185px;
	background: #F5F5F5;
	overflow-y: scroll;
}

.plupload_filelist li {
	padding: 10px 8px;
	background: #f8f8f8;
    background: -moz-linear-gradient(top, #f8f8f8 0%, #eaeaea 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f8f8f8), color-stop(100%,#eaeaea));
    background: -webkit-linear-gradient(top, #f8f8f8 0%,#eaeaea 100%);
    background: -o-linear-gradient(top, #f8f8f8 0%,#eaeaea 100%);
    background: -ms-linear-gradient(top, #f8f8f8 0%,#eaeaea 100%);
    background: linear-gradient(to bottom, #f8f8f8 0%,#eaeaea 100%);
    filter: -webkit-linear-gradient(top, #f8f8f8 0%,#eaeaea 100%);
	border-bottom: 1px solid #d2d2d2;
}

.plupload_filelist_header, .plupload_filelist_footer {
	background: #f8f8f8;
	padding: 8px 8px;
	color: #636363;
}

.plupload_filelist_header {
	border-bottom: 1px solid #d2d2d2;
	padding-top: 10px;
}

.plupload_filelist_footer {border-top: 1px solid #d2d2d2; vertical-align: middle; line-height: 30px;}
.plupload_file_name {float: left; overflow: hidden}
.plupload_file_status {color: #636363; }
.plupload_file_status span {color: #636363;}
.plupload_file_size, .plupload_file_status, .plupload_progress {
	float: right;
	width: 80px;
}
.plupload_file_size, .plupload_file_status, .plupload_file_action {text-align: right; }

.plupload_filelist .plupload_file_name {width: 205px}

.plupload_file_action {
	float: right;
	width: 16px;
	height: 16px;
	margin-left: 15px;
}

.plupload_file_action * {
	display: none;
	width: 16px;
	height: 16px;
	margin-top: 3px;
}

li.plupload_uploading {background: #ECF3DC;
li.plupload_done {color:#AAA}

li.plupload_delete a {
	background: url('../img/delete.gif');
}

li.plupload_failed a {
	background: url('../img/error.gif');
	cursor: default;
}

li.plupload_done a {
	background: url('../img/done.gif');
	cursor: default;
}

.plupload_progress, .plupload_upload_status {
	display: none;
}

.plupload_progress_container {
	margin-top: 3px;
	border: 1px solid #CCC;
	background: #FFF;
	padding: 1px;
}
.plupload_progress_bar {
	width: 0px;
	height: 7px;
	background: #CDEB8B;
}

.plupload_scroll .plupload_filelist_header .plupload_file_action, .plupload_scroll .plupload_filelist_footer .plupload_file_action {
	margin-right: 17px;
}

/* Floats */

.plupload_clear,.plupload_clearer {clear: both;}
.plupload_clearer, .plupload_progress_bar {
	display: block;
	font-size: 0;
	line-height: 0;
}

li.plupload_droptext {
	background: transparent;
	text-align: center;
	vertical-align: middle;
	border: 0;
	line-height: 165px;
}


text:
using UnityEngine;
using System.Collections;

public class EnemyMovement : MonoBehaviour
{
    Transform player;
    PlayerHealth playerHealth;
    EnemyHealth enemyHealth;
    UnityEngine.AI.NavMeshAgent nav;

    void Awake ()
    {
        player = GameObject.FindGameObjectWithTag("Player").transform;
        playerHealth = player.GetComponent<PlayerHealth>();
        enemyHealth = GetComponent<EnemyHealth>();
        nav = GetComponent <UnityEngine.AI.NavMeshAgent> ();
    }

    void Update ()
    {
        if (enemyHealth.currentHealth > 0 && playerHealth.currentHealth > 0)
        {
            nav.SetDestination(player.position);
        }
        else
        {
            nav.enabled = false;
        }
    }
}


text:
'use strict';

import $ from 'jquery';
import firebase from 'firebase/app';
import 'firebase/auth';
import {MaterialUtils} from './Utils';
import page from 'page';

/**
 * Handles the pages/routing.
 */
export default class Router {
  /**
   * Initializes the Friendly Pix controller/router.
   * @constructor
   */
  constructor(auth) {
    this.auth = auth;

    // Dom elements.
    this.pagesElements = $('[id^=page-]');

    // Load the rest of the app - which is split - asynchroneously to speed up initial load.
    const loadComponents = import(/* webpackPrefetch: true */ './async-loaded-components');

    // Shortcuts to async loaded components.
    const loadUser = async (userId) => (await loadComponents).userPage.loadUser(userId);
    const searchHashtag = async (hashtag) => (await loadComponents).searchPage.loadHashtag(hashtag);
    const showHomeFeed = async () => (await loadComponents).feed.showHomeFeed();
    const showGeneralFeed = async () => (await loadComponents).feed.showGeneralFeed();
    const clearFeed = async () => (await loadComponents).feed.clear();
    const showPost = async (postId) => (await loadComponents).post.loadPost(postId);

    // Configuring middlwares.
    page(Router.setLinkAsActive);

    // Configuring routes.
    page('/', () => {this.redirectHomeIfSignedIn(); this.displayPage('splash');});
    page('/home', () => {showHomeFeed(); this.displayPage('feed', true);});
    page('/recent', () => {showGeneralFeed(); this.displayPage('feed');});
    page('/post/:postId', (context) => {showPost(context.params.postId); this.displayPage('post');});
    page('/user/:userId', (context) => {loadUser(context.params.userId); this.displayPage('user-info');});
    page('/search/:hashtag', (context) => {searchHashtag(context.params.hashtag); this.displayPage('search');});
    page('/about', () => {clearFeed(); this.displayPage('about');});
    page('/terms', () => {clearFeed(); this.displayPage('terms');});
    page('/add', () => {this.displayPage('add', true);});
    page('*', () => page('/'));

    // Start routing.
    page();
  }

  /**
   * Displays the given page and hides the other ones.
   * if `onlyAuthed` is set to true then the splash page will be displayed instead of the page if
   * the user is not signed-in.
   * A "page" is the element with ID "page-<id>" in the DOM.
   */
  async displayPage(pageId, onlyAuthed) {
    if (onlyAuthed) {
      // If the page can only be displayed if the user is authenticated then we wait or the auth state.
      await this.auth.waitForAuth;
      if (!firebase.auth().currentUser) {
        return page('/');
      }
    }

    // Display the right page and hide the other ones.
    this.pagesElements.each((index, element) => {
      if (element.id === 'page-' + pageId) {
        $(element).show();
      } else if (element.id === 'page-splash' && onlyAuthed) {
        $(element).fadeOut(1000);
      } else {
        $(element).hide();
      }
    });

    // Force close the Drawer if opened.
    MaterialUtils.closeDrawer();

    // Scroll to top.
    Router.scrollToTop();
  }

  /**
   * Redirect to the home feed if the user is already signed in.
   */
  redirectHomeIfSignedIn() {
    if (firebase.auth().currentUser) {
      page('/home');
    }
  }

  /**
   * Reloads the current page.
   */
  static reloadPage() {
    let path = window.location.pathname;
    if (path === '') {
      path = '/';
    }
    page(path);
  }

  /**
   * Scrolls the page to top.
   */
  static scrollToTop() {
    $('html,body').animate({scrollTop: 0}, 0);
  }

  /**
   * Page.js middleware that highlights the correct menu item/link.
   */
  static setLinkAsActive(context, next) {
    const canonicalPath = context.canonicalPath;
    if (canonicalPath === '') {
      canonicalPath = '/';
    }
    $('.is-active').removeClass('is-active');
    $(`[href="${canonicalPath}"]`).addClass('is-active');
    next();
  }
};


text:
package directconnect_test

import (
	"bytes"
	"fmt"
	"time"

	"github.com/aws/aws-sdk-go/aws"
	"github.com/aws/aws-sdk-go/aws/awserr"
	"github.com/aws/aws-sdk-go/aws/awsutil"
	"github.com/aws/aws-sdk-go/service/directconnect"
)

var _ time.Duration
var _ bytes.Buffer

func ExampleDirectConnect_AllocateConnectionOnInterconnect() {
	svc := directconnect.New(nil)

	params := &directconnect.AllocateConnectionOnInterconnectInput{
		Bandwidth:      aws.String("Bandwidth"),      // Required
		ConnectionName: aws.String("ConnectionName"), // Required
		InterconnectID: aws.String("InterconnectId"), // Required
		OwnerAccount:   aws.String("OwnerAccount"),   // Required
		VLAN:           aws.Long(1),                  // Required
	}
	resp, err := svc.AllocateConnectionOnInterconnect(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_AllocatePrivateVirtualInterface() {
	svc := directconnect.New(nil)

	params := &directconnect.AllocatePrivateVirtualInterfaceInput{
		ConnectionID: aws.String("ConnectionId"), // Required
		NewPrivateVirtualInterfaceAllocation: &directconnect.NewPrivateVirtualInterfaceAllocation{ // Required
			ASN:                  aws.Long(1),                        // Required
			VLAN:                 aws.Long(1),                        // Required
			VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
			AmazonAddress:        aws.String("AmazonAddress"),
			AuthKey:              aws.String("BGPAuthKey"),
			CustomerAddress:      aws.String("CustomerAddress"),
		},
		OwnerAccount: aws.String("OwnerAccount"), // Required
	}
	resp, err := svc.AllocatePrivateVirtualInterface(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_AllocatePublicVirtualInterface() {
	svc := directconnect.New(nil)

	params := &directconnect.AllocatePublicVirtualInterfaceInput{
		ConnectionID: aws.String("ConnectionId"), // Required
		NewPublicVirtualInterfaceAllocation: &directconnect.NewPublicVirtualInterfaceAllocation{ // Required
			ASN:             aws.Long(1),                   // Required
			AmazonAddress:   aws.String("AmazonAddress"),   // Required
			CustomerAddress: aws.String("CustomerAddress"), // Required
			RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{ // Required
				{ // Required
					CIDR: aws.String("CIDR"),
				},
				// More values...
			},
			VLAN:                 aws.Long(1),                        // Required
			VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
			AuthKey:              aws.String("BGPAuthKey"),
		},
		OwnerAccount: aws.String("OwnerAccount"), // Required
	}
	resp, err := svc.AllocatePublicVirtualInterface(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_ConfirmConnection() {
	svc := directconnect.New(nil)

	params := &directconnect.ConfirmConnectionInput{
		ConnectionID: aws.String("ConnectionId"), // Required
	}
	resp, err := svc.ConfirmConnection(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_ConfirmPrivateVirtualInterface() {
	svc := directconnect.New(nil)

	params := &directconnect.ConfirmPrivateVirtualInterfaceInput{
		VirtualGatewayID:   aws.String("VirtualGatewayId"),   // Required
		VirtualInterfaceID: aws.String("VirtualInterfaceId"), // Required
	}
	resp, err := svc.ConfirmPrivateVirtualInterface(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_ConfirmPublicVirtualInterface() {
	svc := directconnect.New(nil)

	params := &directconnect.ConfirmPublicVirtualInterfaceInput{
		VirtualInterfaceID: aws.String("VirtualInterfaceId"), // Required
	}
	resp, err := svc.ConfirmPublicVirtualInterface(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_CreateConnection() {
	svc := directconnect.New(nil)

	params := &directconnect.CreateConnectionInput{
		Bandwidth:      aws.String("Bandwidth"),      // Required
		ConnectionName: aws.String("ConnectionName"), // Required
		Location:       aws.String("LocationCode"),   // Required
	}
	resp, err := svc.CreateConnection(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_CreateInterconnect() {
	svc := directconnect.New(nil)

	params := &directconnect.CreateInterconnectInput{
		Bandwidth:        aws.String("Bandwidth"),        // Required
		InterconnectName: aws.String("InterconnectName"), // Required
		Location:         aws.String("LocationCode"),     // Required
	}
	resp, err := svc.CreateInterconnect(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_CreatePrivateVirtualInterface() {
	svc := directconnect.New(nil)

	params := &directconnect.CreatePrivateVirtualInterfaceInput{
		ConnectionID: aws.String("ConnectionId"), // Required
		NewPrivateVirtualInterface: &directconnect.NewPrivateVirtualInterface{ // Required
			ASN:                  aws.Long(1),                        // Required
			VLAN:                 aws.Long(1),                        // Required
			VirtualGatewayID:     aws.String("VirtualGatewayId"),     // Required
			VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
			AmazonAddress:        aws.String("AmazonAddress"),
			AuthKey:              aws.String("BGPAuthKey"),
			CustomerAddress:      aws.String("CustomerAddress"),
		},
	}
	resp, err := svc.CreatePrivateVirtualInterface(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_CreatePublicVirtualInterface() {
	svc := directconnect.New(nil)

	params := &directconnect.CreatePublicVirtualInterfaceInput{
		ConnectionID: aws.String("ConnectionId"), // Required
		NewPublicVirtualInterface: &directconnect.NewPublicVirtualInterface{ // Required
			ASN:             aws.Long(1),                   // Required
			AmazonAddress:   aws.String("AmazonAddress"),   // Required
			CustomerAddress: aws.String("CustomerAddress"), // Required
			RouteFilterPrefixes: []*directconnect.RouteFilterPrefix{ // Required
				{ // Required
					CIDR: aws.String("CIDR"),
				},
				// More values...
			},
			VLAN:                 aws.Long(1),                        // Required
			VirtualInterfaceName: aws.String("VirtualInterfaceName"), // Required
			AuthKey:              aws.String("BGPAuthKey"),
		},
	}
	resp, err := svc.CreatePublicVirtualInterface(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DeleteConnection() {
	svc := directconnect.New(nil)

	params := &directconnect.DeleteConnectionInput{
		ConnectionID: aws.String("ConnectionId"), // Required
	}
	resp, err := svc.DeleteConnection(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DeleteInterconnect() {
	svc := directconnect.New(nil)

	params := &directconnect.DeleteInterconnectInput{
		InterconnectID: aws.String("InterconnectId"), // Required
	}
	resp, err := svc.DeleteInterconnect(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DeleteVirtualInterface() {
	svc := directconnect.New(nil)

	params := &directconnect.DeleteVirtualInterfaceInput{
		VirtualInterfaceID: aws.String("VirtualInterfaceId"), // Required
	}
	resp, err := svc.DeleteVirtualInterface(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DescribeConnections() {
	svc := directconnect.New(nil)

	params := &directconnect.DescribeConnectionsInput{
		ConnectionID: aws.String("ConnectionId"),
	}
	resp, err := svc.DescribeConnections(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DescribeConnectionsOnInterconnect() {
	svc := directconnect.New(nil)

	params := &directconnect.DescribeConnectionsOnInterconnectInput{
		InterconnectID: aws.String("InterconnectId"), // Required
	}
	resp, err := svc.DescribeConnectionsOnInterconnect(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DescribeInterconnects() {
	svc := directconnect.New(nil)

	params := &directconnect.DescribeInterconnectsInput{
		InterconnectID: aws.String("InterconnectId"),
	}
	resp, err := svc.DescribeInterconnects(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DescribeLocations() {
	svc := directconnect.New(nil)

	var params *directconnect.DescribeLocationsInput
	resp, err := svc.DescribeLocations(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DescribeVirtualGateways() {
	svc := directconnect.New(nil)

	var params *directconnect.DescribeVirtualGatewaysInput
	resp, err := svc.DescribeVirtualGateways(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}

func ExampleDirectConnect_DescribeVirtualInterfaces() {
	svc := directconnect.New(nil)

	params := &directconnect.DescribeVirtualInterfacesInput{
		ConnectionID:       aws.String("ConnectionId"),
		VirtualInterfaceID: aws.String("VirtualInterfaceId"),
	}
	resp, err := svc.DescribeVirtualInterfaces(params)

	if err != nil {
		if awsErr, ok := err.(awserr.Error); ok {
			// Generic AWS error with Code, Message, and original error (if any)
			fmt.Println(awsErr.Code(), awsErr.Message(), awsErr.OrigErr())
			if reqErr, ok := err.(awserr.RequestFailure); ok {
				// A service error occurred
				fmt.Println(reqErr.Code(), reqErr.Message(), reqErr.StatusCode(), reqErr.RequestID())
			}
		} else {
			// This case should never be hit, the SDK should always return an
			// error which satisfies the awserr.Error interface.
			fmt.Println(err.Error())
		}
	}

	// Pretty-print the response data.
	fmt.Println(awsutil.StringValue(resp))
}


text:
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>

	<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
	<title>boost/qvm/map.hpp</title>
	<link href='reno.css' type='text/css' rel='stylesheet'/>

QVM: Quaternions, Vectors, Matrices

boost/qvm/map.hpp

This header defines various view proxies between vectors and matrices.

Synopsis:

#include <boost/qvm/map.hpp>

#include <boost/qvm/map_mat_mat.hpp>
#include <boost/qvm/map_mat_vec.hpp>
#include <boost/qvm/map_vec_mat.hpp>

Copyright (c) 2008-2016 by Emil Dotchevski and Reverge Studios, Inc.

Distributed under the Boost Software License, Version 1.0.


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/linearLayout1"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:orientation="horizontal" >

    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/linearLayout2"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="0.3"
        android:orientation="vertical"
        android:paddingRight="16dp" >

        <TextView
            android:id="@+id/row_id"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:text="Large Text"
            android:textAppearance="?android:attr/textAppearanceLarge" />
    </LinearLayout>

    <TableLayout
        android:id="@+id/tableLayout1"
        android:layout_width="0dp"
        android:layout_height="fill_parent"
        android:layout_weight="1" >

        <TableRow >
            <TextView android:text="latitude: " />
            <TextView
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/latitude"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </TableRow>
        <TableRow >
            <TextView android:text="longitude: " />
            <TextView
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/longitude"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </TableRow>
        <TableRow >
            <TextView android:text="mapx: " />
            <TextView
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/mapx"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </TableRow>
        <TableRow >
            <TextView android:text="mapy: " />
            <TextView
                xmlns:android="http://schemas.android.com/apk/res/android"
                android:id="@+id/mapy"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content" />
        </TableRow>
    </TableLayout>

</LinearLayout><!-- From: file:/C:/Users/semmes/Android-ws/MapCalibrator-master/app/src/main/res/layout/coordinates_row.xml -->


text:
/**
 * Limited cache is a size limited cache container that stores limited number of objects.
 *
 * When {@link #get} is called, the container will try to find the object in the list.
 * If failed it will call the {@link #feeder} to create that object. If there are too many
 * objects in the container, the old ones are removed.
 *
 * __Note:__ This is not using a Least Recently Used policy due to simplicity and performance consideration.
 * @private
 */
Ext.define('Ext.draw.LimitedCache', {

    config: {
        /**
         * @cfg {Number}
         * The amount limit of the cache.
         */
        limit: 40,

        /**
         * @cfg {Function}
         * Function that generates the object when look-up failed.
         * @return {Number}
         */
        feeder: function () {
            return 0;
        },

        /**
         * @cfg {Object}
         * The scope for {@link #feeder}
         */
        scope: null
    },

    cache: null,

    constructor: function (config) {
        this.cache = {};
        this.cache.list = [];
        this.cache.tail = 0;
        this.initConfig(config);
    },

    /**
     * Get a cached object.
     * @param {String} id
     * @param {Mixed...} args Arguments appended to feeder.
     * @return {Object}
     */
    get: function (id) {
        // TODO: Implement cache hit optimization
        var cache = this.cache,
            limit = this.getLimit(),
            feeder = this.getFeeder(),
            scope = this.getScope() || this;

        if (cache[id]) {
            return cache[id].value;
        }
        if (cache.list[cache.tail]) {
            delete cache[cache.list[cache.tail].cacheId];
        }
        cache[id] = cache.list[cache.tail] = {
            value: feeder.apply(scope, Array.prototype.slice.call(arguments, 1)),
            cacheId: id
        };
        cache.tail++;
        if (cache.tail === limit) {
            cache.tail = 0;
        }
        return cache[id].value;
    },

    /**
     * Clear all the objects.
     */
    clear: function () {
        this.cache = {};
        this.cache.list = [];
        this.cache.tail = 0;
    }
});


text:
<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">

  <title>inca.VersionReporter.VersionReporter</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />

         Home

         Trees

         Indices

         Help

        Package inca ::
        Module VersionReporter ::
        Class VersionReporter

[hide private]

[frames] | no frames]

Class VersionReporter

source code

Reporter.Reporter --+
                    |
                   VersionReporter

VersionReporter - Convenience module for creating version
  reporters:

 from inca.VersionReporter import VersionReporter
 reporter = VersionReporter()
 command = 'somecommand -version'
 pattern = '^version "(.*)"'
 ...
 reporter.setPackageName('packageX')
 reporter.setVersionByExecutable(command, pattern)
 reporter.printReporter()

 or

 reporter.setVersionByGptQuery('packageX')

 or

 reporter.setVersionByRpmQuery('packageX')

 or

 reporter->setPackageVersion('x.x.x')

 or

 for subpackage in subpackages:
   reporter.setSubpackageVersion(subpackage, version)

This module is a subclass of Reporter that provides convenience
  methods for creating version reporters.  A version reporter reports this
  version information for a package in the following schema (i.e., this is
  the body of the Inca report):

 <packageVersion>
   <ID>packageX</ID>
   <version>x.x.x</version>
 </packageVersion>

 or

 <packageVersion>
   <ID>packageX</ID>
   <subpackage>
     <ID>subpackageX</ID>
     <version>x.x.x</version>
   </subpackage>
   <subpackage>
     <ID>subpackageY</ID>
     <version>x.x.x</version>
   </subpackage>
 </packageVersion>

Version information can be set using one of the basic methods
  setPackageVersion (for the first example) or setSubpackageVersion (for
  the second). In this case, the user retrieves a package's version
  information directly and uses one of these two methods to report it.
  This module also provides convenience methods that retrieve a package
  version using conventional methods of querying version information.

        Instance Methods
        [hide private]

          __init__(self,
        **attributes)

      Class constructor that returns a new VersionReporter object.

            source code

          getPackageName(self)

      Returns the name of the package.

            source code

          getPackageVersion(self)

      Returns the version of the package.

            source code

          getSubpackageNames(self)

      Returns a list of all the names of all subpackages with a set
      version.

            source code

          getSubpackageVersion(self,
        name)

      Returns the version of subpackage name.

            source code

          reportBody(self)

      Constructs and returns the body of the reporter.

            source code

          setPackageName(self,
        name)

      Set the name of the package.

            source code

          setPackageVersion(self,
        version)

      Report the version of a package as version.

            source code

          setSubpackageVersion(self,
        name,
        version)

      Report the version of subpackage name as version.

            source code

          setVersionByCompiledProgramOutput(self,
        **attrs)

      Retrieve the package version by compiling and running a program and
      matching its output against a pattern.

            source code

          setVersionByExecutable(self,
        command,
        pattern=None,
        timeout=None)

      Retrieve package version information by executing command and greping
      the output for pattern.

            source code

          setVersionByFileContents(self,
        path,
        pattern=None)

      Retrieve the package version by grep'ing the file path for pattern.

            source code

          setVersionByGptQuery(self,
        *prefixes)

      Set subpackage version information by querying GPT for packages
      prefixed with any element of prefixes.

            source code

          setVersionByRpmQuery(self,
        pattern)

      Set subpackage version information by querying GPT for packages that
      contain the regular expression pattern.

            source code

Inherited from Reporter.Reporter:
      __del__,
      addArg,
      addDependency,
      argValue,
      argValues,
      compiledProgramOutput,
      compiledProgramStatusOutput,
      failPrintAndExit,
      getBody,
      getCompleted,
      getCwd,
      getDescription,
      getFailMessage,
      getName,
      getUrl,
      getVersion,
      log,
      loggedCommandOutput,
      loggedCommandStatusOutput,
      printReport,
      processArgv,
      report,
      setBody,
      setCompleted,
      setCwd,
      setDescription,
      setFailMessage,
      setName,
      setResult,
      setUrl,
      setVersion,
      tempFile,
      xmlElement

Inherited from Reporter.Reporter (private):
      _helpXml,
      _iso8601Time,
      _reportXml,
      _timeoutException

        Method Details
        [hide private]

__init__(self,
        **attributes)

(Constructor)

  	source code

Class constructor that returns a new VersionReporter object.  The
  constructor supports the following parameters in addition to those
  supported by Reporter:

 package_name
   the name of the package for which a version is being determined;
   default ''.

 package_version
   the version of the package.

Overrides:
        Reporter.Reporter.__init__

reportBody(self)

  	source code

Constructs and returns the body of the reporter.

Overrides:
        Reporter.Reporter.reportBody

setVersionByCompiledProgramOutput(self,
        **attrs)

  	source code

Retrieve the package version by compiling and running a program and
  matching its output against a pattern.  Returns 1 if successful, else 0.
  The function recognizes the following parameter in addition to those
  supported by the compiledProgramOutput method of Reporter:

pattern
  pattern to search for in program output; default '(.+)'

setVersionByExecutable(self,
        command,
        pattern=None,
        timeout=None)

  	source code

Retrieve package version information by executing command and greping
  the output for pattern.  command is the executable and argument string to
  retrieve the version (e.g., command_name -version) and pattern is a
  pattern containing one grouping (i.e., memory parentheses) to retrieve
  the version from the output.  pattern defaults to '([\d\.]+)' if not
  specified.  Fails if timeout is specified and command does not complete
  within timeout seconds.  Returns 1 if successful, else 0.

setVersionByFileContents(self,
        path,
        pattern=None)

  	source code

Retrieve the package version by grep'ing the file path for pattern.
  pattern defaults to '([\d\.]+)' if not specified.  Returns 1 if
  successful, else 0.

setVersionByGptQuery(self,
        *prefixes)

  	source code

Set subpackage version information by querying GPT for packages
  prefixed with any element of prefixes.  Returns 1 if successful, else
  0.

setVersionByRpmQuery(self,
        pattern)

  	source code

Set subpackage version information by querying GPT for packages that
  contain the regular expression pattern.  Returns 1 if successful, else
  0.

         Home

         Trees

         Indices

         Help

    Generated by Epydoc 3.0.1 on Fri Aug 21 14:47:15 2009

      http://epydoc.sourceforge.net


text:
<?php
/**
 * Smarty plugin
 * @author Kemal BALABAN / kemalbalaban@gmail.com
 */

/**
 * Smarty mb_substr modifier plugin
 *
 * Type:     modifier<br>
 * Name:     mb_substr
 * Purpose:  mb_substr like in php
 * @param string
 * @return string
 */
function smarty_modifier_mb_substr($sString, $dFirst = 0, $dLast = 0, $cSet) {
    if(!function_exists("mb_substr")){
        if($dLast == 0) {
           return substr($sString, $dFirst);
        } else {
           return substr($sString, $dFirst, $dLast);
        }
    }else{
        return mb_substr($sString, $dFirst, $dLast, $cSet);
    }
}

?>


text:
import {Organisation} from "./Organisation";
export class ReportRun {
	organisationGroup: string;
	population: string;
	baselineCohortId: string;
	cohortName: string;
	baselineDate: string;
	reportItemUuid: string;
	scheduled: boolean;
	scheduleDateTime: Date;

}


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

using Microsoft.Owin.Builder;
using Owin;
using Nancy;
using Nancy.Owin;
namespace NancyWebSite
{
    public class Startup
    {
        public void Configuration(IAppBuilder app)
        {
            app.UseNancy();
        }
    }
}


text:
<?php

namespace Faker\Test\Provider\de_AT;

use Faker\Generator;
use Faker\Provider\de_AT\Address;
use PHPUnit\Framework\TestCase;

final class AddressTest extends TestCase
{
    /**
     * @var Generator
     */
    private $faker;

    protected function setUp()
    {
        $faker = new Generator();

        $faker->addProvider(new Address($faker));

        $this->faker = $faker;
    }

    /**
     * @see https://en.wikipedia.org/wiki/List_of_postal_codes_in_Austria
     */
    public function testPostcodeReturnsPostcodeThatMatchesAustrianFormat()
    {
        $postcode = $this->faker->postcode;

        $this->assertRegExp('/^[1-9]\d{3}$/', $postcode);
    }
}


text:
import { Injectable } from '@angular/core';

@Injectable()
export class SubjectService {

  constructor() { }

}


text:
<?php

class RowTest extends PHPUnit_Framework_TestCase
{
    protected $fixture;

    protected function setUp()
    {
        $this->fixture = new \JsonServer\Row(['id' => 0, 'field1' => 1, 'field2' => 'some string']);
    }

    protected function tearDown()
    {
        $this->fixture = NULL;
    }

    public function testGetPassed()
    {
        static::assertEquals($this->fixture->field1, 1, 'get field from row is working');
    }

    public function testSetPassed()
    {
        $this->fixture->field1 = "new value";
        static::assertEquals($this->fixture->field1, 'new value', 'get field from row is working');
    }

    public function testSetFields()
    {
        $data = ['id' => 77, 'field1' => 11, 'field2' => 22];
        $this->fixture->setData($data);
        $dataExpext = ['id' => 0, 'field1' => 11, 'field2' => 22];
        static::assertEquals($this->fixture->toArray(), $dataExpext, 'mass assignment trough setData is working');
    }

    public function testSortingFields()
    {
        $data = ['field2' => 22, 'field1' => 11, 'id' => 77];
        $this->fixture->setData($data);
        $dataExpext = ['id' => 0, 'field1' => 11, 'field2' => 22];
        static::assertEquals($this->fixture->toArray(), $dataExpext, 'fields sorting correctly');
    }

    /**
     * @expectedException        OutOfRangeException
     * @expectedExceptionMessage there is no key unknownField in row
     */
    public function testGetFails()
    {
        $this->fixture->unknownField;
    }

    public function testToArray()
    {
        static::assertArrayHasKey('field1', $this->fixture->toArray(), 'toArray is working');
    }

    public function testSearch()
    {
        static::assertTrue($this->fixture->search('string'));
        static::assertFalse($this->fixture->search('fail'));
    }

    /**
     * @expectedException        InvalidArgumentException
     * @expectedExceptionMessage wrong param should be array
     */
    public function testConstructorFails()
    {
        new \JsonServer\Row('wrong param');
    }

}


text:
console.time('appAll');

window.ee	=	new	EventEmitter();

//	---	Uncontrolled	Components	(неконтролируемый компонент)	---
var	UncontrolledTestInput	=	React.createClass({
    componentDidMount:	function()	{	//ставим	фокус	в	input
        ReactDOM.findDOMNode(this.refs.myTestInput).focus();

        // {/* componentDidMount - один из методов lifecycle компонентов*/}
    },
    onBtnClickHandler:	function()	{
        console.log(this.refs);
        alert(ReactDOM.findDOMNode(this.refs.myTestInput).value);
    },
    render:	function()	{
        return	(

                <input
                    className='test-input'
                    defaultValue=''
                    placeholder='введите	значение'
                    ref='myTestInput'
                        />
                <button	onClick={this.onBtnClickHandler} ref='alert_button'>Показать	alert</button>

        );
    }
});

var	Add	=	React.createClass({
    componentDidMount:	function()	{
        // После загрузки компонента сделать поле автора активным
        ReactDOM.findDOMNode(this.refs.author).focus();
    },
    getInitialState:	function()	{	//устанавливаем	начальное	состояние	(state)
        return	{
            agreeNotChecked: true,
            authorIsEmpty: true,
            textIsEmpty: true
        };
    },
    componentWillReceiveProps:	function(nextProps)	{
        // Возврат Add компонента в начальное состояние
        this.replaceState(this.getInitialState());
        ReactDOM.findDOMNode(this.refs.form).reset()
    },
    onBtnClickHandler:	function(e)	{
        e.preventDefault();
        var	author	=	ReactDOM.findDOMNode(this.refs.author).value;
        var	text	=	ReactDOM.findDOMNode(this.refs.text).value;
        var	item	=	[{
            author:	author,
            text:	text,
            bigText:	'...'
        }];

        window.ee.emit('News.add',	item);
    },
    onCheckRuleClick:	function(e)	{
        this.setState({agreeNotChecked:	!this.state.agreeNotChecked});
    },
    onFieldChange:	function(fieldName,	e)	{
        if	(e.target.value.trim().length	>	0)	{
            this.setState({[''+fieldName]:false})
        }	else	{
            this.setState({[''+fieldName]:true})
        }
    },
    render:	function()	{
        var	agreeNotChecked	=	this.state.agreeNotChecked,
            authorIsEmpty	=	this.state.authorIsEmpty,
            textIsEmpty	=	this.state.textIsEmpty;

        return	(
            <form	className='add	cf' ref='form'>
                        <input
                    type='text'
                    className='add__author'
                    onChange={this.onFieldChange.bind(this,	'authorIsEmpty')}
                    placeholder='Ваше имя'
                    ref='author'
                        />
                        <textarea
                    className='add__text'
                    onChange={this.onFieldChange.bind(this,	'textIsEmpty')}
                    placeholder='Текст новости'
                    ref='text'
                        ></textarea>

                    <input	type='checkbox'	ref='checkrule'	onChange={this.onCheckRuleClick}/>Я	с
                огласен	с	правилами

                {/*	берем	значение	для	disabled	атрибута	из	state	*/}
                <button
                className='add__btn'
                onClick={this.onBtnClickHandler}
                ref='alert_button'
                disabled={agreeNotChecked || authorIsEmpty	||	textIsEmpty}
                >
                Добавить
                </button>
            </form>
        );
    }
});

var	TestInput	=	React.createClass({
    getInitialState:	function()	{
        return	{
            myValue:	false
        };
    },
    onChangeHandler:	function(e)	{
        this.setState({myValue:	e.target.value})
    },
    onBtnClickHandler:	function()	{
        alert(this.state.myValue);
    },
    render:	function()	{
        return	(

                <input
                    className='test-input'
                    value={this.state.myValue}
                    onChange={this.onChangeHandler}
                    placeholder='введите	значение'
                        />
                <button	onClick={this.onBtnClickHandler}>Показать	alert</button>

        );
    }
});

var Article = React.createClass({
    propTypes:	{
        data:	React.PropTypes.shape({
            author:	React.PropTypes.string.isRequired,
            text:	React.PropTypes.string.isRequired,
            bigText:	React.PropTypes.string.isRequired
        })
    },
    // Начальное состояние компонента
    getInitialState:	function()	{
        return	{
            visible:	false,
            vote: 0,
            likesIncreasing : null
        };
    },
    readmoreClick:	function(e)	{
        e.preventDefault();
        this.setState({visible:	true}, function () {
            console.log('Callback функция вызываемая при изменении состояния');
        });
    },
    voteClick: function (e) {
        e.preventDefault();
        this.setState({vote: ++this.state.vote});
    },
    render:	function()	{
        var	data = this.props.data,
            votes = this.state.vote,
            visible	=	this.state.visible;	//	считываем	значение	переменной	из	состояния	компонента

        // с помощью проверки visible - проверяем состояние
        return	(

{data.author}:

{data.text}

                    Подробнее

{data.bigText}

{votes}
                +

        )
    }
});

var	News = React.createClass({
    propTypes:	{
        data: React.PropTypes.array.isRequired
    },
    getInitialState:	function()	{
        return	{
            counter:	0
        }
    },
    render:	function()	{
        var	data = this.props.data;

        var	newsTemplate = data.length ? data.map(function(item,	index)	{
            return	(

            );
        }) :
К сожалению новостей нет
;

        return (

            	0	?	'':'none'}>
                Всего	новостей:	{data.length}

                {newsTemplate}

        );
    }
});

var comment = {
    desc: "Хреновые сегодня новости!"
};

var	myNews	=	[
    {
        author:	'Саша Печкин',
        text:	'В	четверг,	четвертого	числа...',
        bigText:	'в	четыре	с	четвертью	часа	четыре	чёрненьких	чумазеньких	чертёнка	чертили ' +
        'чёрными	чернилами	чертёж.'
    },
    {
        author:	'Просто	Вася',
        text:	'Считаю, что $ должен стоить 35	рублей!',
        bigText:	'А	евро	42!'
    },
    {
        author:	'Гость',
        text:	'Бесплатно.	Скачать. Лучший	сайт - http://localhost:3000',
        bigText:	'На	самом	деле	платно,	просто	нужно	прочитать	очень	длинное	лицензионное соглашение'
    }
];

var	App	= React.createClass({
    getInitialState:	function()	{
        return	{
            news: myNews
        };
    },
    componentDidMount:	function()	{
        //	Слушай	событие	"Создана	новость"  если	событие	произошло,	обнови	this.state.news
        var	self	=	this;
        window.ee.on('News.add', function(item)	{
            var	nextNews = item.concat(self.state.news);
            self.setState({news:	nextNews});
        });
    },
    componentWillUnmount:	function()	{
        // Больше	не	слушай	событие	"Создана	новость"
        window.ee.off('News.add');
    },
    render:	function()	{
        return (

 {/* JSX	- стиль */}

            <TestInput	/>	{/*	добавили	вывод	компонента	*/}
            <UncontrolledTestInput	/>	{/*	добавление неконтролируемого компонента	*/}

Добавить новость

        <Add	/>	{/*	добавление неконтролируемого компонента	*/}

Новости

            <News	data={this.state.news}	/>

        );
    }
});

console.time('app');

ReactDOM.render(
    <App />,
    document.getElementById('content')
);

console.timeEnd('appAll');
console.timeEnd('app');

// 41 стр.