text:
package android.zetterstrom.com.forecast.models;

import android.support.annotation.Nullable;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Date;

/**
 * A data point object represents the various weather phenomena occurring at a specific instant of time, and
 * has many varied properties. All of these properties (except time) are optional, and will only be set if
 * we have that type of information for that location and time. Please note that minutely data points are
 * always aligned to the nearest minute boundary, hourly points to the top of the hour, and daily points to
 * midnight of that day.
 *

 * Data points in the daily data block {@link DataBlock} are special: instead of representing the weather
 * phenomena at a given instant of time, they are an aggregate point representing the weather phenomena that
 * will occur over the entire day. For precipitation fields, this aggregate is a maximum; for other fields,
 * it is an average.
 *

 * Not all fields may contain data. A null field is indicative that it was not present in the response. This
 * is the reason {@link Double} is used as opposed to the primitive double.
 *

 *

 * Created by Kevin Zetterstrom  on 2/10/16.
 */
@SuppressWarnings("unused")
public class DataPoint implements Serializable {

    private static final long serialVersionUID = 1089660797202113138L;

    @SerializedName(ModelConstants.FIELD_TIME)
    private Date mTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_SUMMARY)
    private String mSummary;

    @Nullable
    @SerializedName(ModelConstants.FIELD_ICON)
    private Icon mIcon;

    @Nullable
    @SerializedName(ModelConstants.FIELD_SUNSET_TIME)
    private Date mSunsetTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_SUNRISE_TIME)
    private Date mSunriseTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_MOON_PHASE)
    private Double mMoonPhase;

    @Nullable
    @SerializedName(ModelConstants.FIELD_NEAREST_STORM_DISTANCE)
    private Double mNearestStormDistance;

    @Nullable
    @SerializedName(ModelConstants.FIELD_NEAREST_STORM_BEARING)
    private Double mNearestStormBearing;

    @Nullable
    @SerializedName(ModelConstants.FIELD_PRECIP_INTENSITY)
    private Double mPrecipIntensity;

    @Nullable
    @SerializedName(ModelConstants.FIELD_PRECIP_INTENSITY_MAX)
    private Double mPrecipIntensityMax;

    @Nullable
    @SerializedName(ModelConstants.FIELD_PRECIP_INTENSITY_MAX_TIME)
    private Date mPrecipIntensityMaxTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_PRECIP_PROBABILITY)
    private Double mPrecipProbability;

    @Nullable
    @SerializedName(ModelConstants.FIELD_PRECIP_TYPE)
    private PrecipitationType mPrecipitationType;

    @Nullable
    @SerializedName(ModelConstants.FIELD_PRECIP_ACCUMULATION)
    private Double mPrecipAccumulation;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE)
    private Double mTemperature;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE_MIN)
    private Double mTemperatureMin;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE_MIN_TIME)
    private Date mTemperatureMinTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE_MAX)
    private Double mTemperatureMax;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE_MAX_TIME)
    private Date mTemperatureMaxTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE)
    private Double mApparentTemperature;

    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE_MIN)
    private Double mApparentTemperatureMin;

    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE_MIN_TIME)
    private Date mApparentTemperatureMinTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE_MAX)
    private Double mApparentTemperatureMax;

    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE_MAX_TIME)
    private Date mApparentTemperatureMaxTime;
    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE_LOW)
    private Double mApparentTemperatureLow;

    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE_LOW_TIME)
    private Date mApparentTemperatureLowTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE_HIGH)
    private Double mApparentTemperatureHigh;

    @Nullable
    @SerializedName(ModelConstants.FIELD_APPARENT_TEMPERATURE_HIGH_TIME)
    private Date mApparentTemperatureHighTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE_LOW)
    private Double mTemperatureLow;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE_LOW_TIME)
    private Date mTemperatureLowTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE_HIGH)
    private Double mTemperatureHigh;

    @Nullable
    @SerializedName(ModelConstants.FIELD_TEMPERATURE_HIGH_TIME)
    private Date mTemperatureHighTime;

    @Nullable
    @SerializedName(ModelConstants.FIELD_DEW_POINT)
    private Double mDewPoint;

    @Nullable
    @SerializedName(ModelConstants.FIELD_WIND_SPEED)
    private Double mWindSpeed;

    @Nullable
    @SerializedName(ModelConstants.FIELD_WIND_BEARING)
    private Double mWindBearing;

    @Nullable
    @SerializedName(ModelConstants.FIELD_CLOUD_COVER)
    private Double mCloudCover;

    @Nullable
    @SerializedName(ModelConstants.FIELD_HUMIDITY)
    private Double mHumidity;

    @Nullable
    @SerializedName(ModelConstants.FIELD_PRESSURE)
    private Double mPressure;

    @Nullable
    @SerializedName(ModelConstants.FIELD_VISIBILITY)
    private Double mVisibility;

    @Nullable
    @SerializedName(ModelConstants.FIELD_OZONE)
    private Double mOzone;

    @Nullable
    @SerializedName(ModelConstants.FIELD_UV_INDEX)
    private Double mUvIndex;

    @Nullable
    @SerializedName(ModelConstants.FIELD_UV_INDEX_TIME)
    private Date mUvIndexTime;

    public Date getTime() {
        return mTime;
    }

    @Nullable
    public String getSummary() {
        return mSummary;
    }

    @Nullable
    public Icon getIcon() {
        return mIcon;
    }

    @Nullable
    public Date getSunsetTime() {
        return mSunsetTime;
    }

    @Nullable
    public Date getSunriseTime() {
        return mSunriseTime;
    }

    @Nullable
    public Double getMoonPhase() {
        return mMoonPhase;
    }

    @Nullable
    public Double getNearestStormDistance() {
        return mNearestStormDistance;
    }

    @Nullable
    public Double getNearestStormBearing() {
        return mNearestStormBearing;
    }

    @Nullable
    public Double getPrecipIntensity() {
        return mPrecipIntensity;
    }

    @Nullable
    public Double getPrecipIntensityMax() {
        return mPrecipIntensityMax;
    }

    @Nullable
    public Date getPrecipIntensityMaxTime() {
        return mPrecipIntensityMaxTime;
    }

    @Nullable
    public Double getPrecipProbability() {
        return mPrecipProbability;
    }

    @Nullable
    public PrecipitationType getPrecipitationType() {
        return mPrecipitationType;
    }

    @Nullable
    public Double getPrecipAccumulation() {
        return mPrecipAccumulation;
    }

    @Nullable
    public Double getTemperature() {
        return mTemperature;
    }

    @Nullable
    public Double getTemperatureMin() {
        return mTemperatureMin;
    }

    @Nullable
    public Date getTemperatureMinTime() {
        return mTemperatureMinTime;
    }

    @Nullable
    public Double getTemperatureMax() {
        return mTemperatureMax;
    }

    @Nullable
    public Date getTemperatureMaxTime() {
        return mTemperatureMaxTime;
    }

    @Nullable
    public Double getApparentTemperature() {
        return mApparentTemperature;
    }

    @Nullable
    public Double getApparentTemperatureMin() {
        return mApparentTemperatureMin;
    }

    @Nullable
    public Date getApparentTemperatureMinTime() {
        return mApparentTemperatureMinTime;
    }

    @Nullable
    public Double getApparentTemperatureMax() {
        return mApparentTemperatureMax;
    }

    @Nullable
    public Date getApparentTemperatureMaxTime() {
        return mApparentTemperatureMaxTime;
    }

    @Nullable
    public Double getApparentTemperatureLow() {
        return mApparentTemperatureLow;
    }

    @Nullable
    public Date getApparentTemperatureLowTime() {
        return mApparentTemperatureLowTime;
    }

    @Nullable
    public Double getApparentTemperatureHigh() {
        return mApparentTemperatureHigh;
    }

    @Nullable
    public Date getApparentTemperatureHighTime() {
        return mApparentTemperatureHighTime;
    }
    @Nullable
    public Double getTemperatureLow() {
        return mTemperatureLow;
    }

    @Nullable
    public Date getTemperatureLowTime() {
        return mTemperatureLowTime;
    }

    @Nullable
    public Double getTemperatureHigh() {
        return mTemperatureHigh;
    }

    @Nullable
    public Date getTemperatureHighTime() {
        return mTemperatureHighTime;
    }

    @Nullable
    public Double getDewPoint() {
        return mDewPoint;
    }

    @Nullable
    public Double getWindSpeed() {
        return mWindSpeed;
    }

    @Nullable
    public Double getWindBearing() {
        return mWindBearing;
    }

    @Nullable
    public Double getCloudCover() {
        return mCloudCover;
    }

    @Nullable
    public Double getHumidity() {
        return mHumidity;
    }

    @Nullable
    public Double getPressure() {
        return mPressure;
    }

    @Nullable
    public Double getVisibility() {
        return mVisibility;
    }

    @Nullable
    public Double getOzone() {
        return mOzone;
    }

    @Nullable
    public Double getUvIndex() {
        return mUvIndex;
    }

    @Nullable
    public Date getUvIndexTime() {
        return mUvIndexTime;
    }
}


text:
'use strict';

exports.up = function(db, callback) {
    db.runSql(
        `
        ALTER TABLE users ADD "settings" json;
        ALTER TABLE users ADD "permissions" json;
        ALTER TABLE users ALTER COLUMN "permissions" SET DEFAULT '[]';
        ALTER TABLE users DROP COLUMN "system_id";
    `,
        callback,
    );
};

exports.down = function(db, callback) {
    db.runSql(
        `
      ALTER TABLE users DROP COLUMN "settings";
      ALTER TABLE users DROP COLUMN "permissions";
      ALTER TABLE users ADD COLUMN "system_id" VARCHAR;
    `,
        callback,
    );
};

redpajama_set_name: RedPajamaGithub


text:
const memfs = require("mem-fs");
const editor = require("mem-fs-editor");
const path = require("path");
const yeoman = require("yeoman-environment");

class Template {
  constructor() {
    const env = yeoman.createEnv();
    const res = env.lookup({
      packagePatterns: "daab",
      filePatterns: "lib/daab.js"
    });
    this._templateRoot = path.join(res[0].packagePath, "template");
  }

  get required() {
    return [
      "bin",
      "scripts/.foreverignore",
      "scripts/ping.js",
      "_.gitignore",
      "external-scripts.json",
      "package.json"
    ];
  }

  get renamed() {
    return ["_.gitignore"];
  }

  _restoreName(name) {
    return name.substring(1);
  }

  get choices() {
    return [
      ".cfignore",
      ".dockerignore",
      "Berksfile",
      "Dockerfile",
      "Procfile",
      "Vagrantfile"
    ];
  }

  questions(defaults) {
    return [
      {
        name: "packageName",
        message: "package name",
        default: defaults["packageName"]
      },
      {
        name: "version",
        message: "version",
        default: "0.1.0"
      },
      {
        name: "description",
        message: "description"
      },
      {
        name: "author",
        message: "author"
      },
      {
        name: "files",
        type: "checkbox",
        message: "choose files you need",
        choices: this.choices
      }
    ];
  }

  get daabStarter() {
    return {
      packageName: "starter",
      version: "0.3.9",
      author: "L is B Corp.",
      description: "A simple helpful robot for your Company",
      files: this.choices
    };
  }

  copyTo(dest, context, cb) {
    const templatePath = file => path.join(this._templateRoot, file);
    const destinationPath = file => path.join(dest, file);

    const fs = editor.create(memfs.create());
    this.required
      .filter(e => this.renamed.includes(e))
      .forEach(entry => {
        fs.copyTpl(
          templatePath(entry),
          destinationPath(this._restoreName(entry)),
          context
        );
      });
    this.required
      .filter(e => !this.renamed.includes(e))
      .forEach(entry => {
        fs.copyTpl(templatePath(entry), destinationPath(entry), context);
      });
    this.choices
      .filter(c => context.files.includes(c))
      .forEach(entry => {
        fs.copy(templatePath(entry), destinationPath(entry));
      });
    fs.commit(cb);
  }
}

module.exports = { Template };


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/drawer_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true" >

    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fitsSystemWindows="true"

        >

        <android.support.design.widget.AppBarLayout
            android:id="@+id/appbar"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                android:background="?attr/colorPrimary"
                app:layout_scrollFlags="scroll|enterAlways"
                app:popupTheme="@style/ThemeOverlay.AppCompat.Light" >

                </android.support.v7.widget.Toolbar>

            <android.support.design.widget.TabLayout
                android:id="@+id/tabs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />
        </android.support.design.widget.AppBarLayout>

        <android.support.v4.view.ViewPager
            android:id="@+id/viewpager"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />

        <android.support.design.widget.FloatingActionButton
            android:id="@+id/fab"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="right|bottom"
            android:layout_marginBottom="@dimen/md_keylines"
            android:layout_marginRight="@dimen/md_keylines"
            app:srcCompat="@drawable/ic_add"
            android:tint="@color/white"/>

    </android.support.design.widget.CoordinatorLayout>

    <android.support.design.widget.NavigationView
        android:id="@+id/nav_view"
        android:layout_width="wrap_content"
        android:layout_height="match_parent"
        android:layout_gravity="start"
        android:fitsSystemWindows="true"
        app:headerLayout="@layout/nav_header_main"
        app:menu="@menu/activity_main_drawer" />

</android.support.v4.widget.DrawerLayout>


text:
<?php

namespace Dzangocart\Bundle\SubscriptionBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class DzangocartSubscriptionBundle extends Bundle
{
}


text:
#ifndef __GTK_ACTIVATABLE_H__
#define __GTK_ACTIVATABLE_H__

#if !defined (__GTK_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk.h> can be included directly."
#endif

#include <gtk/deprecated/gtkaction.h>

G_BEGIN_DECLS

#define GTK_TYPE_ACTIVATABLE            (gtk_activatable_get_type ())
#define GTK_ACTIVATABLE(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatable))
#define GTK_ACTIVATABLE_CLASS(obj)      (G_TYPE_CHECK_CLASS_CAST ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatableIface))
#define GTK_IS_ACTIVATABLE(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_ACTIVATABLE))
#define GTK_ACTIVATABLE_GET_IFACE(obj)  (G_TYPE_INSTANCE_GET_INTERFACE ((obj), GTK_TYPE_ACTIVATABLE, GtkActivatableIface))

typedef struct _GtkActivatable      GtkActivatable; /* Dummy typedef */
typedef struct _GtkActivatableIface GtkActivatableIface;

/**
 * GtkActivatableIface:
 * @update: Called to update the activatable when its related action's properties change.
 * You must check the #GtkActivatable:use-action-appearance property only apply action
 * properties that are meant to effect the appearance accordingly.
 * @sync_action_properties: Called to update the activatable completely, this is called internally when
 * #GtkActivatable:related-action property is set or unset and by the implementor when
 * #GtkActivatable:use-action-appearance changes.
 *
 * > This method can be called with a %NULL action at times.
 *
 * Since: 2.16
 *
 * Deprecated: 3.10
 */

struct _GtkActivatableIface
{
  /*< private >*/
  GTypeInterface g_iface;

  /*< public >*/

  /* virtual table */
  void   (* update)                   (GtkActivatable *activatable,
		                       GtkAction      *action,
		                       const gchar    *property_name);
  void   (* sync_action_properties)   (GtkActivatable *activatable,
		                       GtkAction      *action);
};

GDK_DEPRECATED_IN_3_10
GType      gtk_activatable_get_type                   (void) G_GNUC_CONST;

GDK_DEPRECATED_IN_3_10
void       gtk_activatable_sync_action_properties     (GtkActivatable *activatable,
						       GtkAction      *action);

GDK_DEPRECATED_IN_3_10
void       gtk_activatable_set_related_action         (GtkActivatable *activatable,
						       GtkAction      *action);
GDK_DEPRECATED_IN_3_10
GtkAction *gtk_activatable_get_related_action         (GtkActivatable *activatable);

GDK_DEPRECATED_IN_3_10
void       gtk_activatable_set_use_action_appearance  (GtkActivatable *activatable,
						       gboolean        use_appearance);
GDK_DEPRECATED_IN_3_10
gboolean   gtk_activatable_get_use_action_appearance  (GtkActivatable *activatable);

/* For use in activatable implementations */
GDK_DEPRECATED_IN_3_10
void       gtk_activatable_do_set_related_action      (GtkActivatable *activatable,
						       GtkAction      *action);

G_END_DECLS

#endif /* __GTK_ACTIVATABLE_H__ */


text:
(function () {
    $('body').on('click', '.tree .tree-heading', function () {
        var $tree = $(this).parents('.tree').first();
        if ($tree.parents('.tree-group').first().length > 0) {
            if ($tree.hasClass('minimize')) {
                $tree.parents('.tree-group').first().find('.tree').addClass('minimize', 500);
                $tree.removeClass('minimize');
            } else {
                $tree.addClass('minimize');
            }

        } else {
            $tree.toggleClass('minimize', 500);
        }
    });
})();


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>OpenNI 1.5.4: Member List</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

OpenNI 1.5.4

Main Page

Modules

Namespaces

Classes

Files

Class List

Class Index

Class Hierarchy

Class Members

xn

ModuleExportedProductionNode

xn::ModuleExportedProductionNode Member List

This is the complete list of members for xn::ModuleExportedProductionNode, including all inherited members.

Create(Context &context, const XnChar *strInstanceName, const XnChar *strCreationInfo, NodeInfoList *pNeededTrees, const XnChar *strConfigurationDir, ModuleProductionNode **ppInstance)=0	xn::ModuleExportedProductionNode	 [pure virtual]

Destroy(ModuleProductionNode *pInstance)=0	xn::ModuleExportedProductionNode	 [pure virtual]

EnumerateProductionTrees(Context &context, NodeInfoList &TreesList, EnumerationErrors *pErrors)=0	xn::ModuleExportedProductionNode	 [pure virtual]

GetDescription(XnProductionNodeDescription *pDescription)=0	xn::ModuleExportedProductionNode	 [pure virtual]

ModuleExportedProductionNode()	xn::ModuleExportedProductionNode	 [inline]

~ModuleExportedProductionNode()	xn::ModuleExportedProductionNode	 [inline, virtual]

<address class="footer">
Generated on Wed Nov 26 2014 12:18:21 for OpenNI 1.5.4 by

 1.7.6.1
</address>


text:
var mongoose = require('mongoose'),
    _ = require('lodash');

module.exports = function (req, res) {
    var connectionDB = mongoose.connection.db;
    connectionDB.collection('items', function (err, collection) {
        collection.findOne({
            type: 'StockItem',
            barcode: req.body.barcode
        }, function(err, result){
            if (err) {
                console.log(err)
            } else {
                res.jsonp([result]);
            }
        })
    });
};


text:
layout: page
title: Contact Us
permalink: /contact/
---

<div class="py2">
    <form action="https://formspree.io/{{ site.email }}" method="POST" class="form-stacked form-light">
        <input type="text" name="email" class="input mobile-block" placeholder="Email Address">
        <textarea type="text" name="content" class="input mobile-block" rows="5" placeholder="What would you like to say?"></textarea>
        <input type="submit" class="button button-blue button-big mobile-block" value="Submit">
    </form>
</div>


text:
/**
 * This is code is released under the
 * Apache License Version 2.0 http://www.apache.org/licenses/.
 *
 * (c) Daniel Lemire, http://lemire.me/en/
 */

#ifndef EXTERNALVECTOR_H_
#define EXTERNALVECTOR_H_
#include "common.h"
using namespace std;

template<class CMP>
class BinaryFileBuffer
{
public:
    typedef uint32_t Type;
    typedef vector<Type> DataType;

    enum
    {
        BUFFERSIZE = 512
    };
    FILE *fd;
    vector<DataType> buf;
    size_t currentpointer, mEnd;
    size_t localpointer;
    bool valid;
    CMP mCmp;
    size_t sizeofdata;

    BinaryFileBuffer(const BinaryFileBuffer & o) :
        fd(o.fd), buf(o.buf), currentpointer(o.currentpointer), mEnd(o.mEnd),
        localpointer(o.localpointer), valid(o.valid), mCmp(o.mCmp),
        sizeofdata(o.sizeofdata)
    {
    }
    BinaryFileBuffer() :
        fd(NULL), buf(), currentpointer(0), mEnd(0), localpointer(0),
        valid(false), mCmp(CMP()), sizeofdata(0)
    {
    }

    BinaryFileBuffer<CMP> & operator=(const BinaryFileBuffer<CMP> &o)
    {
        fd = o.fd;
        buf = o.buf;
        currentpointer = o.currentpointer;
        mEnd = o.mEnd;
        localpointer = o.localpointer;
        valid = o.valid;
        mCmp = o.mCmp;
        sizeofdata = o.sizeofdata;
        return *this;
    }
    BinaryFileBuffer(FILE * f, size_t start, size_t end, CMP cmp,
                     vector<DataType>& Buf, size_t datasize) :
        fd(f), buf(Buf), currentpointer(start), mEnd(end), localpointer(0),
        valid(true), mCmp(cmp), sizeofdata(datasize)
    {
        buf.reserve(BUFFERSIZE);
        reload();
    }

    void reset(size_t start)
    {
        currentpointer = start;
        localpointer = 0;
        valid = true;
        reload();
    }

    size_t size()
    {
        return mEnd - currentpointer;
    }

    void reload()
    {
        assert(currentpointer <= mEnd);
        size_t howmanycanIread = BUFFERSIZE;
        if (howmanycanIread > mEnd - currentpointer)
            howmanycanIread = mEnd - currentpointer;
        if (howmanycanIread == 0)
        {
            buf.resize(0);
            valid = false;
            return;
        }
        buf.resize(howmanycanIread);

        int result = fseek(fd, currentpointer * sizeofdata * sizeof(Type), SEEK_SET);
        if (result != 0)
        {
            cerr << "failed to seek" << endl;
            throw runtime_error("failed to seek");
        }
        for (size_t k = 0; k < howmanycanIread; ++k)
        {
            buf[k].resize(sizeofdata);
            size_t howmany = fread(&(buf[k][0]), sizeof(Type), sizeofdata, fd);
            if (howmany != sizeofdata)
            {
                cerr << " Expected to read " << sizeofdata << " but found "
                     << howmany << endl;
                throw runtime_error("failed to read the number expected");
            }
        }

        localpointer = 0;
    }

    void hasMore()
    {
        return valid;
    }
    bool empty()
    {
        return !valid;
    }

    const DataType & peek() const
    {
        return buf[localpointer];
    }

    bool operator<(const BinaryFileBuffer<CMP> & bfb) const
    {
        return mCmp(this->peek(), bfb.peek());
    }

    __attribute__ ((pure))
    bool operator>(const BinaryFileBuffer<CMP> & bfb) const
    {
        return mCmp(bfb.peek(), this->peek());
    }
    void pop(DataType & container)
    {
        ++currentpointer;
        container = buf[localpointer++];
        assert(localpointer <= buf.size());
        if (localpointer == buf.size())
            reload();
    }
private:

};

class externalvector
{

public:
    externalvector(size_t datasize) :
        fd(NULL), N(0), sizeofdata(datasize)
    {
    }
    typedef uint32_t Type;
    typedef vector<Type> DataType;

    ~externalvector()
    {
    }
    externalvector(const externalvector & other) :
        fd(NULL), N(0),  sizeofdata(other.sizeofdata)
    {
        if ((other.fd != NULL) or (fd != NULL))
        {
            cerr << "please don't use copy constructor for non-trivial things"
                 << endl;
            throw runtime_error("you are abusing copy constructor");
        }
        assert(other.fd == NULL);
        assert(other.N == 0);
    }
    externalvector & operator=(const externalvector & other)
    {
        if ((other.fd != NULL) or (fd != NULL))
        {
            cerr << "please don't use assignment for non-trivial things"
                 << endl;
            throw runtime_error("you are abusing assignment operator");
        }
        assert(other.fd == NULL);
        assert(other.N == 0);
        fd = NULL;
        N = 0;
        sizeofdata = other.sizeofdata;
        return *this;
    }

    void swap(externalvector & o)
    {
        FILE * const tmpfd = fd;
        const size_t tmpN = N;
        const size_t sd = sizeofdata;
        //
        fd = o.fd;
        N = o.N;
        sizeofdata = o.sizeofdata;
        //
        o.fd = tmpfd;
        o.N = tmpN;
        o.sizeofdata = sd;
    }

    off_t getFileSize()
    {
        fseek(fd, 0L, SEEK_END);
        return ftell(fd);
    }

    enum
    {
        DEFAULTBLOCKSIZE = 4194304, verbose = false, vverbose = false
    };

    // this is not a true shuffle, it shuffles by block,
    // blocks are *not* merged. For my purposes, I did not
    // need a true shuffle.
    void shuffle(const size_t BLOCKSIZE = DEFAULTBLOCKSIZE)
    {
        vector<DataType> buffer;
        for (size_t k = 0; k < size(); k += BLOCKSIZE)
        {
            if (k + BLOCKSIZE < size())
            {
                loadACopy(buffer, k, k + BLOCKSIZE);
                random_shuffle(buffer.begin(), buffer.end());
                copyAt(buffer, k);
            }
            else
            {
                loadACopy(buffer, k, size());
                random_shuffle(buffer.begin(), buffer.end());
                copyAt(buffer, k);
            }
        }

    }

    template<class CMP>
    void sort(CMP & comparator, const size_t BLOCKSIZE = DEFAULTBLOCKSIZE)
    {
        priority_queue<BinaryFileBuffer<CMP> , vector<BinaryFileBuffer<CMP> > ,
                       greater<BinaryFileBuffer<CMP> > > pq;

        const size_t howmanybuffers = N / BLOCKSIZE + (N % BLOCKSIZE == 0 ? 0
                                      : 1);

        vector < vector<DataType> > buffers(howmanybuffers);
        size_t buffercounter = 0;

        vector<DataType> buffer;
        buffer.reserve(BLOCKSIZE);
        for (size_t rowindex = 0; rowindex < size(); rowindex += BLOCKSIZE)
        {

            size_t end = size();
            if (rowindex + BLOCKSIZE < size())
                end = rowindex + BLOCKSIZE;
            loadACopy(buffer, rowindex, end);
            std::sort(buffer.begin(), buffer.end(), comparator);
            copyAt(buffer, rowindex);
            BinaryFileBuffer<CMP> bfb(fd, rowindex, end, comparator,
                                      buffers[buffercounter++], sizeofdata);

            pq.push(bfb);
        }
        if (buffercounter != buffers.size())
            throw runtime_error("This should never happen.");
        if (howmanybuffers == 1)
            return;// we are done
        // we must merge which requires a new file
        FILE * newfd = ::tmpfile();
        if (newfd == NULL)
        {
            throw runtime_error("could not open temp file");
        }

        DataType container;
        const bool bfbparanoid = false;
        DataType lastentry;
        bool first = true;

        size_t counter = 0;
        BinaryFileBuffer<CMP> bfb;
        while (!pq.empty())
        {
            bfb = pq.top();
            pq.pop();

            bfb.pop(container);
            if (bfbparanoid)
            {
                if (!first)
                {
                    if (comparator(container, lastentry))
                        cout << " we have a problem at counter = " << counter
                             << endl;
                    assert(!comparator(container, lastentry));
                    lastentry = container;
                }
                else
                {
                    first = false;
                    lastentry = container;
                }
            }

            size_t result = fwrite(&container[0], sizeof(Type), sizeofdata,
                                   newfd);
            if (result != sizeofdata)
            {
                cerr << "Error appending to the file " << endl;
                break;
            }
            ++counter;
            if (!bfb.empty())
            {
                pq.push(bfb); // add it back
            }
        }
        ::fclose(fd);
        fd = newfd;
    }

    bool append(const DataType & d)
    {
        assert(d.size()==sizeofdata);
        int results = fseek(fd, 0, SEEK_END);
        if (results != 0)
        {
            cerr << "could not seek to end of file" << endl;
            throw runtime_error("bad seek");
        }
        size_t result = fwrite(&d[0], sizeof(Type), sizeofdata, fd);
        if (result != sizeofdata)
        {
            cerr << "Error appending to the file "  << endl;
            return false;
        }
        ++N;
        return true;
    }
    void  dangerouslyfastappend(const DataType & d)
    {
        assert(d.size()==sizeofdata);
        fwrite(&d[0], sizeof(Type), sizeofdata, fd);
        ++N;
    }

    // caller is responsible for calling close
    void open()
    {
        if (vverbose)
            cout << "opening..." << endl;
        fd = tmpfile();
        if (fd == NULL)
        {
            cerr << "Can't create a temp file" << endl;
            throw runtime_error("could not open temp file");
        }
    }

    void close()
    {

        if (fd != NULL)
        {
            ::fclose(fd);
            fd = NULL;
            N = 0;
        }
    }

    void loadACopy(vector<DataType> & buffer, size_t begin, size_t end) const
    {
        buffer.resize(end - begin);
        int result = fseek(fd, begin * sizeofdata * sizeof(Type), SEEK_SET);
        if (result != 0)
        {
            cerr << "could not seek to " << begin << endl;
            throw runtime_error("bad seek");
        }
        for (size_t k = 0; k < buffer.size(); ++k)
        {
            buffer[k].resize(sizeofdata);
            assert(buffer[k].size()==sizeofdata);
            size_t result2 = fread(&(buffer[k][0]), sizeof(Type), sizeofdata, fd);

            assert(buffer[k].size()==sizeofdata);
            if (result2 != sizeofdata)
            {
                cerr << "Error reading from file " << endl;
                throw runtime_error("bad read");
            }
        }

    }

    DataType get(const size_t pos)
    {

        if (fd == NULL)
        {
            cerr << "no file to read from! Open the file first!" << endl;
            throw runtime_error("file not open");
        }
        DataType ans(sizeofdata);
        int result = fseek(fd, pos * sizeofdata * sizeof(Type), SEEK_SET);
        if (result != 0)
        {
            cerr << "could not seek to " << pos << endl;
            throw runtime_error("bad seek");
        }
        size_t howmany = fread(&ans[0], sizeof(Type), sizeofdata, fd);
        if (howmany != sizeofdata)
        {
            cerr << "Error reading from file " << endl;
            //cerr << strerror(errno) << endl;
            throw runtime_error("bad read");
        }
        return ans;
    }
    void append(const vector<DataType> & buffer)
    {
        int result = fseek(fd, 0, SEEK_END);
        if (result != 0)
        {
            cerr << "could not seek to end of file" << endl;
            throw runtime_error("bad seek");
        }
        for (size_t k = 0; k < buffer.size(); ++k)
        {
            assert(buffer[k].size()==sizeofdata);
            size_t result2 = fwrite(&(buffer[k][0]), sizeof(Type), sizeofdata, fd);
            if (result2 != sizeofdata)
            {
                cerr << "Error write from file " << endl;
                //cerr << strerror(errno) << endl;
                throw runtime_error("bad write");
            }
        }
        N += buffer.size();
    }

    void copyAt(const vector<DataType> & buffer, size_t begin)
    {
        int result = fseek(fd, begin * sizeofdata * sizeof(Type), SEEK_SET);
        if (result != 0)
        {
            cerr << "could not seek to " << begin << endl;
            throw runtime_error("bad seek");
        }
        for (size_t k = 0; k < buffer.size(); ++k)
        {
            assert(buffer[k].size()==sizeofdata);
            size_t result2 = fwrite(&(buffer[k][0]), sizeof(Type), sizeofdata, fd);
            if (result2 != sizeofdata)
            {
                cerr << "Error write from file " << endl;
                //cerr << strerror(errno) << endl;
                throw runtime_error("bad write");
            }
        }

    }

    size_t size() const
    {
        return N;
    }

private:

    FILE * fd; //file descriptor
    size_t N;
    size_t sizeofdata;
};

// Lexico (basic)
class Cmp
{
public:

    Cmp(vector<size_t> & indexes) :
        mIndexes(indexes)
    {

    }
    Cmp() :
        mIndexes()
    {
    }
    Cmp& operator=(const Cmp & v)
    {
        mIndexes = v.mIndexes;
        return *this;
    }

    __attribute__ ((pure))
    bool operator ()(const vector<uint32_t> & a, const vector<uint32_t> & b) const
    {
        for (vector<size_t>::const_iterator i = mIndexes.begin(); i
                != mIndexes.end(); ++i)
        {
            const size_t k = *i;
            if (a[k] < b[k])
                return true;
            else if (a[k] > b[k])
                return false;
        }
        return false;

    }
    vector<size_t> mIndexes;
};

#endif /* EXTERNALVECTOR_H_ */


text:
package com.mmm.findtherythm;

import java.util.HashMap;

import com.mmm.findtherythm.utils.ScoreUtil;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;
import android.view.View.OnClickListener;

public class IndexActivity extends Activity {
	private static final String TAG = "IndexActivity";
	GameActivity gameActivity;
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_index);

		Log.i(TAG, "init index activity");

		// Component declaration
		Button buttonJouer = (Button) findViewById(R.id.buttonJouer);
		Button buttonScore = (Button) findViewById(R.id.buttonScore);
		Button buttonQuit = (Button) findViewById(R.id.buttonQuit);

		// Handler declaration
		buttonJouer.setOnClickListener(buttonJouerHandler);
		buttonScore.setOnClickListener(buttonScoreHandler);
		buttonQuit.setOnClickListener(buttonQuitHandler);
	}

	OnClickListener buttonJouerHandler = new OnClickListener() {
		@Override
		public void onClick(View v) {
			Factory.getInstance();
			Intent intent = new Intent(IndexActivity.this, GameActivity.class);
			startActivityForResult(intent,0);
		}
	};

	OnClickListener buttonScoreHandler = new OnClickListener() {
		@Override
		public void onClick(View v) {
			setContentView(R.layout.score);
			ImageView back = (ImageView) findViewById(R.id.backFromScore);
			back.setOnClickListener(new OnClickListener() {
				@Override
				public void onClick(View v) {
					//setContentView(R.layout.activity_index);
					startActivity(new Intent(IndexActivity.this , IndexActivity.class));
				}
			});
			HashMap<String, Integer> map = ScoreUtil.getListScore();
			int i = 0;
			for (String mapKey : map.keySet()) {
				i++;
				if(i == 1) {
					TextView name1 = (TextView) findViewById(R.id.name1);
					name1.setText(mapKey);
					TextView score1 = (TextView) findViewById(R.id.score1);
					score1.setText(map.get(mapKey).toString());
				}
				else if(i == 2) {
					TextView name2 = (TextView) findViewById(R.id.name2);
					name2.setText(mapKey);
					TextView score2 = (TextView) findViewById(R.id.score2);
					score2.setText(map.get(mapKey).toString());
				}
				else if(i == 3) {
					TextView name3 = (TextView) findViewById(R.id.name3);
					name3.setText(mapKey);
					TextView score3 = (TextView) findViewById(R.id.score3);
					score3.setText(map.get(mapKey).toString());
				}
			}
		}
	};

	OnClickListener buttonQuitHandler = new OnClickListener() {
		@Override
		public void onClick(View v) {
			IndexActivity.this.finish();
		}
	};

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.index, menu);
		return true;
	}

}


text:
<?php

namespace Dive\APIBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
use Dive\APIBundle\Entity\DataEntity;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;

/**
* @Route("/vu/api/v2")
*/

class VUDataController extends BaseController
{

  var $dataSet = 1;
    /**
     * Returns DIVE entities, based on a keywords
     * @Route("/search")
     */
    public function searchAction()
    {
      // start time measurement
      $timeStart = microtime(true);

      $this->saveSession();
      // get search data
      $searchData = $this->getSearchData('search');

      // end time measurement
      $timeEnd = microtime(true);

      // return data
      return $this->dataResponse(array(
        'took' => $timeEnd - $timeStart,
        'query'=> $searchData['query'],
        'fromCache'=>$searchData['fromCache'],
        ), $searchData['data'], $searchData['key']);
    }

  /**
   *  Returns DIVE entities, based on a set of ids
     * @Route("/searchids")
     */
  public function searchIdsAction()
  {
      // start time measurement
    $timeStart = microtime(true);

      // get search data
    $searchData = $this->getSearchData('searchids');

      // end time measurement
    $timeEnd = microtime(true);

      // return data
    return $this->dataResponse(array(
      'took' => $timeEnd - $timeStart,
      'query'=> $searchData['query'],
      'fromCache'=>$searchData['fromCache'],
      ), $searchData['data'], $searchData['key']);
  }

  // creates search query from keywordlist, offset and limit

  private function getSearchQuery($keywordsList, $offset, $limit){
        // create query
   $query = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
   PREFIX dive: <http://purl.org/collections/nl/dive/>
   PREFIX foaf: <http://xmlns.com/foaf/0.1/>
   PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
   PREFIX sem: <http://semanticweb.cs.vu.nl/2009/11/sem/>
   PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
   SELECT DISTINCT ?entity ?type (SAMPLE(?asource) AS ?source) (SAMPLE(?aplaceholder) AS ?placeholder) (SAMPLE(?alabel) as ?label) (SAMPLE(?atimestamp) as ?timestamp) (SAMPLE(?adbpediaType) AS ?dbpediaType) WHERE {
    {
      OPTIONAL { ?entity rdfs:label ?alabel. }
      OPTIONAL { ?entity dc:description ?adescription.}
      ' . $keywordsList . '
      ?entity rdf:type ?type.
      FILTER(?type=sem:Actor || ?type = sem:Place || ?type = sem:Event || ?type = dive:Person || ?type = skos:Concept)
      OPTIONAL { ?entity dive:depictedBy ?depict. ?depict dive:source ?asource. ?depict dive:placeholder ?aplaceholder. }
      OPTIONAL { ?entity dive:hasTimeStamp ?atimestamp }
      OPTIONAL { ?entity dive:dbpediaType ?adbpediatype }
    }
    UNION{
      OPTIONAL { ?entity rdfs:label ?alabel. }
      OPTIONAL { ?entity dc:description|dcterms:abstract|dcterms:description ?adescription.}
      '.$keywordsList.'
      ?entity rdf:type ?type.
      FILTER(?type = dive:MediaObject)
      ?entity dive:source ?asource. ?entity dive:placeholder ?aplaceholder.
      OPTIONAL { ?entity dive:hasTimeStamp ?atimestamp }
      OPTIONAL { ?entity dive:dbpediaType ?adbpediatype }
    }
  }
  GROUP BY ?entity ?type OFFSET '.$offset.' LIMIT ' . $limit;
  return $query;
}

  // convert rawdata to dive entities

private function createDataEntity($rawData){
  $dataEntity = new DataEntity();

  // create and fill entity
  $dataEntity
  ->setUid(isset($rawData->entity) ? $rawData->entity->value : 'no-id')
  ->setType(isset($rawData->type) ? $rawData->type->value : 'no-type',true)
  ->setTitle(isset($rawData->label) ? $rawData->label->value : 'no-title')
  ->setDescription(isset($rawData->description) ? $rawData->description->value : 'no-description')

  ->setDepictedBySource(isset($rawData->source) ? $rawData->source->value : '')
  ->setDepictedByPlaceHolder(isset($rawData->placeholder) ? $rawData->placeholder->value : '')

  ->setDateStart(isset($rawData->timestamp) ? $rawData->timestamp->value : '')
  ->setDateEnd('')

  ->setEvent(isset($rawData->event) ? $rawData->event->value : '');

  // convert dbpedia persons actors to person entities (should be managed in database)
  if($dataEntity->getType() =='Actor'){
    if( $dataEntity->getDBPedia() && (strpos('person',  $dataEntity->getDBPedia()) > -1 || strpos('people', $dataEntity->getDBPedia()) > -1 )){
      $dataEntity->setType('Person');
    } else{
      $dataEntity->setType('Concept');
    }
  }
    // empty depicted_by if not an Event or MediaObject
  if ($dataEntity->getType() != 'Event' && $dataEntity->getType() !='MediaObject'){
    $dataEntity->setDepictedByPlaceHolder('');///search/images/' + urlencode(preg_replace("/[^[:alnum:][:space:]]/ui", '',$dataEntity->getTitle())) + '.jpg');
    $dataEntity->setDepictedBySource('');//'/search/images/' + urlencode(preg_replace("/[^[:alnum:][:space:]]/ui", '',$dataEntity->getTitle())) + '.jpg');
}
return $dataEntity;
}

  // get search data

private function encodeId($uid){
  $pos = strrpos($uid, "/");
  if ($pos) {
    $entityId = substr($uid,$pos+1);

    // only decode entity id if it's not yet encoded!
    if (urldecode($entityId) == $entityId){
      $entityId = urlencode($entityId);
    }

    $uid = substr($uid,0,$pos+1) . $entityId;
  }
  return $uid;
}

  // get search data

private function getSearchData($type){

      // get parameters
  $keywords = $this->getRequest()->get('keywords','');
  $offset = intval($this->getRequest()->get('offset',0));
  $limit = intval($this->getRequest()->get('limit',850));
  $key = sha1($keywords.$offset.$limit);

      // get data from cache
  $data = $this->getCachedQuery($type,$key);
  $fromCache = true;

  $keywordsList = '';

  switch($type){
    case 'search':

      // make keywords list
    $keywords = explode(' ', $keywords);

    foreach($keywords as $k){
      $searchStr = $k;
      $exclude = '';
      if (substr($k,0,1) == '-'){
        $searchStr = substr($k,1);
        $exclude = '! ';
      }
      $keywordsList .= ' FILTER ('.$exclude.'(CONTAINS(lcase(str(?alabel)), "'. addslashes(strtolower($searchStr)).'") || CONTAINS(lcase(str(?adescription)), "'. addslashes(strtolower($searchStr)).'")))';
    }
    break;
    case 'searchids':

    $keywords = explode(' ', $keywords);

        $keywordsList = 'FILTER('; // )
        $keywordsCount = 0;
        foreach($keywords as $k){
          if ($k != ''){
            if ($keywordsList != 'FILTER('){
              $keywordsList .= ' || ';
            }
            $keywordsCount++;
            $keywordsList .= '?entity = <'. addslashes($k).'>';
          }
        }
        /* (*/   $keywordsList .= ')';
        // if no keywords or ids specificied return immediately
        if ($keywordsCount == 0){
          return false;
        }
        break;
      }
     // create query
      $query = $this->getSearchQuery($keywordsList, $offset, $limit);
      // check if query should be dumped
      $this->checkDumpQuery($query);

      if (!$data){

    // if no data from cache was found, get query from server

        $fromCache = false;
        $data = json_encode($this->convertToDiveData($this->getQuery($query)));
          // store result in cache
        $this->setCachedQuery($type, $key, $data);
      }

      return array(
        'query'=>$query,
        'data'=>$data,
        'fromCache' => $fromCache,
        'key'=>$key
        );
    }

    public function convertToDiveData($data){
     $json = json_decode($data);
     $diveData = array();

      // json succeeded
     if (json_last_error() == 0 && isset($json->results) && isset($json->results->bindings)) {
        // loop al bindings
      $ids = array();
      for ($i =0, $len = count($json->results->bindings); $i<$len; $i++){
        $result = $this->createDataEntity($json->results->bindings[$i]);
        if (!array_key_exists($result->getUID(), $ids)){
          $diveData[] = $result;
          $ids[$result->getUID()] = true;
        }
      }
    }
    return $diveData;
  }

   /**
    * Returns DIVE entity details, based on a entity id
     * @Route("/entity/details")
     */
   public function detailsAction()
   {
    // start time measurement
    $timeStart = microtime(true);

    $this->saveSession();

    // get parameters
    $id = $this->encodeId(($this->getRequest()->get('id',0)));
    $key = sha1($id);

    // get data from cache
    $data = $this->getCachedQuery('details',$key);
    $fromCache = true;

    // create query
    $query = 'PREFIX sem: <http://semanticweb.cs.vu.nl/2009/11/sem/>
    PREFIX dive: <http://purl.org/collections/nl/dive/>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    SELECT DISTINCT ?label ?description ?link ?timestamp ?type (SAMPLE(?adbpediatype) AS ?dbpediatype) (SAMPLE(?aplaceholder) AS ?placeholder) (SAMPLE(?asource) AS ?source) WHERE {
     <'.$id.'> rdfs:label ?label.
     <'.$id.'> rdf:type ?type.
     FILTER(?type=sem:Actor || ?type = sem:Place || ?type = sem:Event || ?type = dive:Person || ?type = skos:Concept || ?type=dive:MediaObject)
     OPTIONAL { <'.$id.'> dc:description|dcterms:abstract|dcterms:description ?description. }
     OPTIONAL { <'.$id.'> dive:hasExternalLink ?link. FILTER(str(?link) != "") }
     OPTIONAL { <'.$id.'> dive:depictedBy ?adepict. ?adepict dive:source ?asource. ?adepict dive:placeholder ?aplaceholder.}
     OPTIONAL { <'.$id.'> dive:source ?asource. ?entity dive:placeholder ?aplaceholder.}
     OPTIONAL { <'.$id.'> rdf:type sem:Event. <'.$id.'> dive:hasTimeStamp ?timestamp }
     OPTIONAL { <'.$id.'> dive:dbpediaType ?adbpediatype }
   } GROUP BY ?label ?description ?link ?timestamp ?type LIMIT 1';

  // check if query should be dumped
   $this->checkDumpQuery($query);

   if (!$data){
    $fromCache = false;
    $data = $this->convertToDiveData($this->getQuery($query));
    if ($data){
      $data[0]->setUid($id);
    }
    $data = json_encode($data);
    $this->setCachedQuery('details', $key, $data);
  }
  $timeEnd = microtime(true);

  return $this->dataResponse(array(
   'took' => $timeEnd - $timeStart,
   'query'=> $query,
   'fromCache'=>$fromCache
   ), $data, $key);

}

   /**
     * Returns DIVE entities related to entity with entityId id
     * @Route("/entity/related")
     */
   public function relatedAction()
   {
    // start time measurement
    $timeStart = microtime(true);

    $this->saveSession();

    // get parameters
    $id = $this->encodeId($this->getRequest()->get('id',0));
    $offset = intval($this->getRequest()->get('offset',0));
    $limit = intval($this->getRequest()->get('limit',850));
    $key = sha1($id.$offset.$limit);

    // get data from cache
    $data = $this->getCachedQuery('related',$key);

    $fromCache = true;

    // create query
    $query = 'PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
    PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
    PREFIX sem: <http://semanticweb.cs.vu.nl/2009/11/sem/>
    PREFIX dive: <http://purl.org/collections/nl/dive/>
    PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
    SELECT DISTINCT ?entity ?type (SAMPLE(?aevent) AS ?event) (SAMPLE(?asource) AS ?source) (SAMPLE(?aplaceholder) AS ?placeholder) (SAMPLE(?alabel) as ?label) (SAMPLE(?atimestamp) as ?timestamp) (SAMPLE(?adbpediaType) AS ?dbpediaType)
    WHERE {
      {
        { SELECT DISTINCT ?entity ?aevent WHERE {
          { <'.$id.'> (owl:sameAs*|^owl:sameAs*) ?same.
          ?same (dive:isRelatedTo|^dive:isRelatedTo) ?entity.
        } UNION{
          <'.$id.'> (dive:isRelatedTo|^dive:isRelatedTo) ?entity.
        } UNION{
          <'.$id.'> (dive:depictedBy|^dive:depictedBy) ?entity.
        } UNION{
          <'.$id.'> (dive:isRelatedTo|^dive:isRelatedTo) ?aevent.
          ?aevent rdf:type sem:Event.
          ?aevent (dive:isRelatedTo|^dive:isRelatedTo) ?entity.
        } UNION{
          <'.$id.'> (owl:sameAs*|^owl:sameAs*) ?same.
          ?same (dive:isRelatedTo|^dive:isRelatedTo) ?aevent.
          ?aevent rdf:type sem:Event.
          ?aevent (dive:isRelatedTo|^dive:isRelatedTo) ?entity.
        }
      } GROUP BY ?entity ?aevent
    }
    FILTER(?entity != <'.$id.'>)
    ?entity rdf:type ?type.
    FILTER(?type=sem:Actor || ?type = sem:Place || ?type = sem:Event || ?type = dive:Person || ?type = skos:Concept || ?type=dive:MediaObject)
    OPTIONAL { ?entity rdfs:label ?alabel. }
    OPTIONAL { ?entity dive:depictedBy ?adepict. ?adepict dive:source ?asource. ?adepict dive:placeholder ?aplaceholder.}
    OPTIONAL { ?entity dive:source ?asource. ?entity dive:placeholder ?aplaceholder.}
    OPTIONAL { ?entity dive:hasTimeStamp ?atimestamp }
    OPTIONAL { ?entity dive:dbpediaType ?adbpediatype }
  }
}
GROUP BY ?entity ?type
ORDER BY ASC(?event) ASC(?timestamp) OFFSET '.$offset.' LIMIT '. $limit;

// check if query should be dumped
$this->checkDumpQuery($query);

if (!$data){
// get data

  $fromCache = false;
  $data = json_encode($this->convertToDiveData($this->getQuery($query)));
  $this->setCachedQuery('related', $key, $data);
}

$timeEnd = microtime(true);

if ($this->getRequest()->get('showQuery',false)){
 echo $query . "\n\n";
}

return $this->dataResponse(array(
 'took' => $timeEnd - $timeStart,
 'query'=> $query,
 ), $data,$key);
}

 // get a query
  public function getQuery($query, $entailment = 'rdfslite'){
    $databaseHost = $this->container->getParameter('dive_database_host');
    $url = $databaseHost . '?format=json&entailment='.$entailment.'&query=' . urlencode($query);
    return $this->getCurl($url);
  }

   /**
     * @Route("/cache/flush/yesiamsure")
     */
   public function cacheFlushAction()
   {
     die('Deprecated call, please use the command line to clear the cache!');
  }

  public function checkDumpQuery($query){
    if ($this->getRequest()->get('dump',false) == 'query'){
      echo '<pre>';
      echo htmlentities($query);
      echo '</pre>';
      die();
    }

  }

}


text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.

using System;
using Microsoft.Build.Utilities;
using Microsoft.Build.Framework;
using GenFacades;
using Microsoft.Cci.Extensions;
using System.Linq;
using System.Diagnostics;

namespace Microsoft.DotNet.Build.Tasks
{
    /// <summary>
    /// Runs GenFacades In-Proc.
    /// </summary>
    public sealed class GenFacadesTask : BuildTask
    {
        [Required]
        public string Seeds { get; set; }

        [Required]
        public string Contracts { get; set; }

        [Required]
        public string FacadePath { get; set; }

        public Version AssemblyFileVersion { get; set; }

        public bool ClearBuildAndRevision { get; set; }

        public bool IgnoreMissingTypes { get; set; }

        public bool IgnoreBuildAndRevisionMismatch { get; set; }

        public bool BuildDesignTimeFacades { get; set; }

        public string InclusionContracts { get; set; }

        public string SeedLoadErrorTreatment { get; set; }

        public string ContractLoadErrorTreatment { get; set; }

        public ITaskItem[] SeedTypePreferencesUnsplit { get; set; }

        public bool ForceZeroVersionSeeds { get; set; }

        public bool ProducePdb { get; set; } = true;

        public string PartialFacadeAssemblyPath { get; set; }

        public bool BuildPartialReferenceFacade { get; set; }

        public override bool Execute()
        {
            TraceLogger logger = new TraceLogger(Log);

            try
            {
                Trace.Listeners.Add(logger);
                ErrorTreatment seedLoadErrorTreatment = ErrorTreatment.Default;
                ErrorTreatment contractLoadErrorTreatment = ErrorTreatment.Default;

                if (SeedLoadErrorTreatment != null)
                {
                    seedLoadErrorTreatment = (ErrorTreatment)Enum.Parse(typeof(ErrorTreatment), SeedLoadErrorTreatment);
                }
                if (ContractLoadErrorTreatment != null)
                {
                    contractLoadErrorTreatment = (ErrorTreatment)Enum.Parse(typeof(ErrorTreatment), ContractLoadErrorTreatment);
                }

                string[] seedTypePreferencesUnsplit = null;
                if (SeedTypePreferencesUnsplit != null)
                {
                    seedTypePreferencesUnsplit = SeedTypePreferencesUnsplit.Select(iti => $"{iti.ItemSpec}={iti.GetMetadata("Assembly")}").ToArray();
                    Trace.WriteLine("seedTypePreferencesUnsplit: " + string.Join(" || ", seedTypePreferencesUnsplit));
                }

                bool result = Generator.Execute(
                    Seeds,
                    Contracts,
                    FacadePath,
                    AssemblyFileVersion,
                    ClearBuildAndRevision,
                    IgnoreMissingTypes,
                    IgnoreBuildAndRevisionMismatch,
                    BuildDesignTimeFacades,
                    InclusionContracts,
                    seedLoadErrorTreatment,
                    contractLoadErrorTreatment,
                    seedTypePreferencesUnsplit,
                    ForceZeroVersionSeeds,
                    ProducePdb,
                    PartialFacadeAssemblyPath,
                    BuildPartialReferenceFacade);

                if (!result)
                {
                    Log.LogError("Errors were encountered when generating facade(s).");
                }

                return result;
            }
            catch (Exception e)
            {
                Log.LogErrorFromException(e, showStackTrace: false);
                return false;
            }
            finally
            {
                Trace.Listeners.Remove(logger);
            }
        }
    }

    // Trace listener which writes to the MSBuild log.
    public class TraceLogger : TraceListener
    {
        private readonly TaskLoggingHelper _log;

        public TraceLogger(TaskLoggingHelper log)
        {
            _log = log;
        }

        public override void Write(string message)
        {
            _log.LogMessage(message);
        }

        public override void WriteLine(string message)
        {
            _log.LogMessage(message + Environment.NewLine);
        }
    }
}


text:
using namespace llvm;

extern "C" {

LLVMValueSubclassId LLVM_General_GetValueSubclassId(LLVMValueRef v) {
	switch(unwrap(v)->getValueID()) {
#define VALUE_SUBCLASS_ID_CASE(class) case Value::class ## Val: return LLVM ## class ## SubclassId;
LLVM_GENERAL_FOR_EACH_VALUE_SUBCLASS(VALUE_SUBCLASS_ID_CASE)
#undef VALUE_SUBCLASS_ID_CASE
	default: break;
	}
	return LLVMValueSubclassId(0);
}

LLVMValueRef LLVM_General_CreateArgument(
	LLVMTypeRef t,
	const char *name
) {
	return wrap(new Argument(unwrap(t), name));
}

}


text:
package com.fasterxml.jackson.databind.type;

import java.util.*;

import com.fasterxml.jackson.databind.BaseMapTest;
import com.fasterxml.jackson.databind.JavaType;

/**
 * Simple tests to verify for generic type binding functionality
 * implemented by {@link TypeBindings} class.
 */
public class TestTypeBindings
    extends BaseMapTest
{
    static class AbstractType<A,B> { }

    static class LongStringType extends AbstractType<Long,String> { }

    static class InnerGenericTyping<K, V> extends AbstractMap<K, Collection<V>>
    {
        @Override
        public Set<java.util.Map.Entry<K, Collection<V>>> entrySet() {
            return null;
        }
        public class InnerClass extends AbstractMap<K, Collection<V>> {
            @Override
            public Set<java.util.Map.Entry<K, Collection<V>>> entrySet() {
                return null;
            }
        }
    }

    // for [databind#76]
    @SuppressWarnings("serial")
    static class HashTree<K, V> extends HashMap<K, HashTree<K, V>> { }

    /*
    /**********************************************************
    /* Test methods
    /**********************************************************
     */

    private final TypeFactory DEFAULT_TF = TypeFactory.defaultInstance();

    public void testInnerType() throws Exception
    {
        JavaType type = DEFAULT_TF.constructType(InnerGenericTyping.InnerClass.class);
        assertEquals(MapType.class, type.getClass());
        JavaType keyType = type.getKeyType();
        assertEquals(Object.class, keyType.getRawClass());
        JavaType valueType = type.getContentType();
        assertEquals(Collection.class, valueType.getRawClass());
        JavaType vt2 = valueType.getContentType();
        assertEquals(Object.class, vt2.getRawClass());
    }

    // for [databind#76]
    public void testRecursiveType()
    {
        JavaType type = DEFAULT_TF.constructType(HashTree.class);
        assertNotNull(type);
    }

    public void testBindingsBasics()
    {
        TypeBindings b = TypeBindings.create(Collection.class,
                TypeFactory.unknownType());
        // let's just call it -- should probably try to inspect but...
        assertNotNull(b.toString());
        assertEquals(Object.class, b.getBoundType(0).getRawClass());
        assertNull(b.getBoundName(-1));
        assertNull(b.getBoundType(-1));
        assertNull(b.getBoundName(1));
        assertNull(b.getBoundType(1));

        assertFalse(b.equals("foo"));
    }

    public void testInvalidBindings()
    {
        JavaType unknown = TypeFactory.unknownType();
        try {
            TypeBindings.create(AbstractType.class, unknown);
            fail("Should not pass");
        } catch (IllegalArgumentException e) {
            verifyException(e, "Cannot create TypeBindings");
            verifyException(e, "class expects 2");
        }
    }
}


text:
<?php

namespace Homie\Display\Devices;

use Homie\Display\Annotation\DisplayDevice;
use Homie\Node;

/**
 * @DisplayDevice("Display.Devices.EchoDevice")
 */
class EchoDevice implements DeviceInterface
{

    const TYPE = 'echo';

    /**
     * @param Node $node
     * @param string $content
     */
    public function display(Node $node, string $content)
    {
        unset($node);

        echo $content;
    }

    /**
     * @return string
     */
    public static function getType() : string
    {
        return self::TYPE;
    }
}


text:
#ifndef SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_
#define SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_

#include <string>
#include "hmi_message_handler/hmi_message_adapter_impl.h"
#include "dbus/dbus_message_controller.h"
#include "smart_objects/smart_object.h"

namespace hmi_message_handler {

namespace smart_objects = NsSmartDeviceLink::NsSmartObjects;

/**
 * \brief adapter for DBus
 */
class DBusMessageAdapter : public HMIMessageAdapterImpl,
                           public dbus::DBusMessageController {
 public:
  typedef utils::SharedPtr<application_manager::Message> MessageSharedPointer;
  explicit DBusMessageAdapter(HMIMessageHandler* hmi_msg_handler);
  ~DBusMessageAdapter();
  void SendMessageToHMI(MessageSharedPointer message);

  /**
   * \brief subscribes to signals
   */
  void SubscribeTo();

 private:
  static const std::string SDL_SERVICE_NAME;
  static const std::string SDL_OBJECT_PATH;
  static const std::string HMI_SERVICE_NAME;
  static const std::string HMI_OBJECT_PATH;

  /**
   * \brief sends request to HMI
   * \param obj request
   */
  void Request(const smart_objects::SmartObject& obj);

  /**
   * \brief sends notification to HMI
   * \param obj notification
   */
  void Notification(const smart_objects::SmartObject& obj);

  /**
   * \brief sends response to HMI
   * \param obj response
   */
  void Response(const smart_objects::SmartObject& obj);

  /**
   * \brief sends error response to HMI
   * \param obj error
   */
  void ErrorResponse(const smart_objects::SmartObject& obj);

  /**
   * \brief sends message to core
   * \param obj
   */
  void SendMessageToCore(const smart_objects::SmartObject& obj);
};

}  // namespace hmi_message_handler

#endif  // SRC_COMPONENTS_HMI_MESSAGE_HANDLER_INCLUDE_HMI_MESSAGE_HANDLER_DBUS_MESSAGE_ADAPTER_H_


text:
import { isAbsolute, toPortablePath } from "../../src/util/PathUtils"
import { expect } from "chai"

describe(`path-utils`, () => {
    describe("isAbsolute", () => {
        it("discriminates cross platform relative paths", () => {
            const testMap: [string, boolean][] = [
                ["FILENAME.db", false],
                ["./FILENAME.db", false],
                [".FILENAME.db", false],
                ["path/FILENAME.db", false],
                ["pathFILENAME.db", false],
                ["..FILENAME.db", false],
                ["../filename.db", false],
                ["C:\\dirFILENAME.db", true],
                ["/dir/filename.db", true],
            ]
            for (const [aPath, expected] of testMap) {
                expect(
                    isAbsolute(aPath),
                    `${aPath} did not match ${expected}`,
                ).to.equal(expected)
            }
        })
    })

    describe("toPortablePath", () => {
        for (const platform of [`darwin`, `win32`]) {
            let realPlatform: string

            describe(`Platform ${platform}`, () => {
                beforeEach(() => {
                    realPlatform = process.platform
                    Object.defineProperty(process, `platform`, {
                        configurable: true,
                        value: platform,
                    })
                })

                afterEach(() => {
                    Object.defineProperty(process, `platform`, {
                        configurable: true,
                        value: realPlatform,
                    })
                })

                describe(`toPortablePath`, () => {
                    if (platform !== `win32`) {
                        it(`should change paths on non-Windows platform`, () => {
                            const inputPath = `C:\\Users\\user\\proj`
                            const outputPath = inputPath
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })
                    } else {
                        it(`shouldn't change absolute posix paths when producing portable path`, () => {
                            const inputPath = `/home/user/proj`
                            const outputPath = inputPath
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`shouldn't change absolute paths that are already portable`, () => {
                            const inputPath = `/c:/Users/user/proj`
                            const outputPath = `/c:/Users/user/proj`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should normalize the slashes in relative Windows paths`, () => {
                            const inputPath = `..\\Users\\user/proj`
                            const outputPath = `../Users/user/proj`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should transform Windows paths into their posix counterparts (uppercase drive)`, () => {
                            const inputPath = `C:\\Users\\user\\proj`
                            const outputPath = `/C:/Users/user/proj`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should transform Windows paths into their posix counterparts (lowercase drive)`, () => {
                            const inputPath = `c:\\Users\\user\\proj`
                            const outputPath = `/c:/Users/user/proj`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should transform Windows paths into their posix counterparts (forward slashes)`, () => {
                            const inputPath = `C:/Users/user/proj`
                            const outputPath = `/C:/Users/user/proj`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should support Windows paths that contain both backslashes and forward slashes`, () => {
                            const inputPath = `C:/Users\\user/proj`
                            const outputPath = `/C:/Users/user/proj`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should support drive: Windows paths`, () => {
                            const inputPath = `C:`
                            const outputPath = `/C:`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should support UNC Windows paths (\\\\[server]\\[sharename]\\)`, () => {
                            const inputPath = `\\\\Server01\\user\\docs\\Letter.txt`
                            const outputPath = `/unc/Server01/user/docs/Letter.txt`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should support Long UNC Windows paths (\\\\?\\[server]\\[sharename]\\)`, () => {
                            const inputPath = `\\\\?\\Server01\\user\\docs\\Letter.txt`
                            const outputPath = `/unc/?/Server01/user/docs/Letter.txt`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should support Long UNC Windows paths (\\\\?\\UNC\\[server]\\[sharename]\\)`, () => {
                            const inputPath = `\\\\?\\UNC\\Server01\\user\\docs\\Letter.txt`
                            const outputPath = `/unc/?/UNC/Server01/user/docs/Letter.txt`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should support Long UNC Windows paths (\\\\?\\[drive_spec]:\\)`, () => {
                            const inputPath = `\\\\?\\C:\\user\\docs\\Letter.txt`
                            const outputPath = `/unc/?/C:/user/docs/Letter.txt`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })

                        it(`should support Long UNC Windows paths with dot (\\\\.\\[physical_device]\\)`, () => {
                            const inputPath = `\\\\.\\PhysicalDevice\\user\\docs\\Letter.txt`
                            const outputPath = `/unc/.dot/PhysicalDevice/user/docs/Letter.txt`
                            expect(toPortablePath(inputPath)).to.equal(
                                outputPath,
                            )
                        })
                    }
                })
            })
        }
    })
})


text:
set -eu

if [[ -z "$1" ]]; then
  info "Please provide a keyspace"
  exit 1
fi

KEYSPACE="$1"

result=$(nodetool snapshot "${KEYSPACE}")

if [[ $? -ne 0 ]]; then
  echo "Error while making snapshot"
  exit 1
fi

timestamp=$(echo "$result" | awk '/Snapshot directory: / { print $3 }')

mkdir -p /tmp/backup

for path in $(find "/var/lib/cassandra/data/${KEYSPACE}" -name $timestamp); do
  table=$(echo "${path}" | awk -F "[/-]" '{print $7}')
  mkdir /tmp/backup/$table
  mv $path /tmp/backup/$table
done

tar -zcf /tmp/backup.tar.gz -C /tmp/backup .

nodetool clearsnapshot "${KEYSPACE}"


text:
inline int foo() { return 0; }

#else

#define IS_SYSHEADER
#include __FILE__

int bar() { return 0; }
inline int baz() { return 0; }
static int qux() { return 42; }

#endif


text:
	var dashBoardDetails = {};
		var data;
		var dataGeneric;
		var Analytics = {};
		var reportAttributes;
//code change Mohit : read metrics from JSON file
		function readTextFile(file,callback) {
            var rawFile = new XMLHttpRequest();
            rawFile.overrideMimeType("application/json");
            rawFile.open("GET", file, true);
            rawFile.onreadystatechange = function() {
                if (rawFile.readyState === 4 && rawFile.status == "200") {
                    callback(rawFile.responseText);
                }
            }
            rawFile.send(null);
		}
// code change Mohit : read metrics from JSON file
		function getReportAttributesForDashboard(part) {

            readTextFile("https://raw.githubusercontent.com/moawasthi/TableauIntegration/master/Dashboard_ColumnDetails.json", function(text) {
                 data = JSON.parse(text);
                for (var i = 0; i < data.length; i++) {
                if(data[i].Dashboard1.Name == part)
                {
                    dashBoardDetails = {
                        Measures : data[i].Dashboard1.Measures,
                        Dimensions : data[i].Dashboard1.Dimensions,
                        textTemplates :  data[i].Dashboard1.textTemplates,
                    };

                }

                else if(data[i].SimpleDashboard.Name == part)
                {
                    dashBoardDetails = {
                        Measures : data[i].SimpleDashboard.Measures,
                        Dimensions : data[i].SimpleDashboard.Dimensions,
                        textTemplates :  data[i].SimpleDashboard.textTemplates
                    };

                }
                }
			});
			readTextFile("https://raw.githubusercontent.com/moawasthi/TableauIntegration/master/Mobile.json", function(text) {
				dataGeneric = JSON.parse(text);
			   for (var i = 0; i < dataGeneric.length; i++) {

				   if(dataGeneric[i].tableaumetrics.dashboard == part)
				   {
					   reportAttributes = {
						   dashboard: dataGeneric[i].tableaumetrics.dashboard,
						   reportUrl: dataGeneric[i].tableaumetrics.reportUrl,
						   sheetName: dataGeneric[i].tableaumetrics.dashboardPart,
						   NLG : dataGeneric[i].tableaumetrics.NLG
					   };
				   }
				   else
				   {
					   console.log(dataGeneric[i].tableaumetrics.dashboard);
					   console.log(part);
				   }
			   }
			});
		}
// code change Mohit : Summary code
		function getSummaryData() {
            var loopcounter = 0;
            var finalOutput = [];
            var finalObject;
            var finalObjectArray = [];
            var analysisArray = [];
            var returnObject;
            workbook = viz.getWorkbook();
            for( var i=0;i<reportAttributes.sheetName.length;i++) {
            sheet = viz.getWorkbook().getActiveSheet().getWorksheets().get(reportAttributes.sheetName[i]);
                options = {
                    maxRows: 0, // Max rows to return. Use 0 to return all rows
                    ignoreAliases: false,
                    ignoreSelection: true,
                    includeAllColumns: false
                };

            sheet.getSummaryDataAsync(options).then(function(t) {
                table = t;
                var tcol = table.getColumns();
                //the data returned from the tableau API
                var columns = table.getColumns();
                var datafromTableau = table.getData();
                var getIndexAttributes = [];
            var niceData = reduceToObjects(columns, datafromTableau);
            analysisArray.push(niceData);
            loopcounter++;
            if(loopcounter == reportAttributes.sheetName.length )
            {
                AnalyzeJSON(analysisArray);
            }
            });
           }
		}

		function getKPIForMobileDashboard(k,b,measure, dimensions)
        {

            if(typeof b[0]["" + measure.Name + ""] === "undefined")
            {
                console.log("Measure  " + measure.Name + " is not defined");
                return;
            }
             if((measure.Name == "SUM(Profit)"))
             {
                max =  b.reduce((max, b) => Math.max(max, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                min = b.reduce((min, b) => Math.min(min, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                for (var i =0;i<b.length;i++)
                {
                    if(k==0)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder1 + ""] = b[i]["" + dimensions.Dimension1 + ""];
                            Analytics["" + measure.PlaceHolder2 + ""] = b[i]["" + measure.Name + ""];
                        }
                    }
                    if(k==3)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder15 + ""] = b[i]["" + dimensions.Dimension5 + ""];
                            Analytics["" + measure.PlaceHolder16 + ""] = b[i]["" + measure.Name + ""];
                        }
                    }

                }
             }

             if((measure.Name == "SUM(Quantity)"))
             {
                max =  b.reduce((max, b) => Math.max(max, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                min = b.reduce((min, b) => Math.min(min, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                for (var i =0;i<b.length;i++)
                {
                    if(k==0)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder3 + ""] = b[i]["" + dimensions.Dimension1 + ""];
                            Analytics["" + measure.PlaceHolder4 + ""] = b[i]["" + measure.Name + ""];
                        }
                    }
                    if(k==3)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder17 + ""] = b[i]["" + dimensions.Dimension5 + ""];
                            Analytics["" + measure.PlaceHolder18 + ""] = b[i]["" + measure.Name + ""];
                        }
                    }

                }
             }
             if((measure.Name == "SUM(Sales)"))
             {
                max =  b.reduce((max, b) => Math.max(max, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                min = b.reduce((min, b) => Math.min(min, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                for (var i =0;i<b.length;i++)
                {
                    if(k==0)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder5 + ""] = b[i]["" + dimensions.Dimension1 + ""];
                            Analytics["" + measure.PlaceHolder6 + ""] = b[i]["" + measure.Name + ""];
                        }
                    }
                    if(k==3)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder19 + ""] = b[i]["" + dimensions.Dimension5 + ""];
                            Analytics["" + measure.PlaceHolder20 + ""] = b[i]["" + measure.Name + ""];
                        }
                    }

                }
             }

             if(measure.Name == "Measure Values")
             {

                max =  b.reduce((max, b) => Math.max(max, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                min = b.reduce((min, b) => Math.min(min, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                for (var i =0;i<b.length;i++)
                {
                    if(k==1)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder7 + ""] = b[i]["" + measure.Name + ""];
                            Analytics["" + measure.PlaceHolder10 + ""] = b[i]["" + dimensions.Dimension3 + ""];
                            Analytics["" + measure.PlaceHolder22 + ""] = b[i]["" + dimensions.Dimension2 + ""];
                        }
                    }
                    if(k==2)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder11 + ""] = b[i]["" + measure.Name + ""];
                            Analytics["" + measure.PlaceHolder12 + ""] = b[i]["" + dimensions.Dimension4 + ""];
                            Analytics["" + measure.PlaceHolder21 + ""] = b[i]["" + dimensions.Dimension2 + ""];
                        }
                    }

                }
             }
        }
        function getKPIForSimpleDashboard(k,b,measure, dimensions)
        {
            if(typeof b[0]["" + measure.Name + ""] === "undefined")
            {
                console.log("Measure  " + measure.Name + " is not defined");
                return;
            }
             if((measure.Name == "SUM(Sales)"))
             {
                max =  b.reduce((max, b) => Math.max(max, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                min = b.reduce((min, b) => Math.min(min, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                for (var i =0;i<b.length;i++)
                {
                    if(k==0)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder2 + ""] = b[i]["" + dimensions.Dimension1 + ""];
                            Analytics["" + measure.PlaceHolder1 + ""] = b[i]["" + measure.Name + ""];
                        }
                    }
                }
             }

             if((measure.Name == "AVG(Discount)"))
             {
                max =  b.reduce((max, b) => Math.max(max, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                min = b.reduce((min, b) => Math.min(min, b["" + measure.Name + ""].replace("$","").replace(",","")), b[0]["" + measure.Name + ""].replace("$","").replace(",",""));
                for (var i =0;i<b.length;i++)
                {
                    if(k==0)
                    {
                        if(b[i]["" + measure.Name + ""].replace("$","").replace(",","") == max)
                        {
                            Analytics["" + measure.PlaceHolder4 + ""] = b[i]["" + dimensions.Dimension1 + ""];
                            Analytics["" + measure.PlaceHolder3 + ""] = b[i]["" + measure.Name + ""];
                        }
                    }

                }
             }
        }

        function getKPI(k,b,measure, dimensions, dashboard) {
            var min;
            var max;
            if(typeof measure === 'undefined')
            {
                return;
            }
            if(dashboard == "mobile")
            {
                getKPIForMobileDashboard(k,b,measure, dimensions);
            }
            else if (dashboard == "SimpleDashboard")
            {
                getKPIForSimpleDashboard(k,b,measure, dimensions);
            }
            else
            {
                Analytics = {};
            }
        }

           function getPlaceHolders(dashBoardDetails, analysisArray)
           {
               var textToReturn;
                for(var k=0;k<analysisArray.length;k++)
                    {
                       try{
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['SUM(Profit)'], dashBoardDetails.Dimensions, reportAttributes.dashboard);
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['SUM(Quantity)'], dashBoardDetails.Dimensions,reportAttributes.dashboard);
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['SUM(Sales)'], dashBoardDetails.Dimensions,reportAttributes.dashboard);
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['MeasureValuesByOrderDate'], dashBoardDetails.Dimensions,reportAttributes.dashboard);
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['MeasureValuesByCategory'], dashBoardDetails.Dimensions,reportAttributes.dashboard);
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['SUM(Profit)SubCategory'], dashBoardDetails.Dimensions,reportAttributes.dashboard);
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['SUM(Quantity)SubCategory'], dashBoardDetails.Dimensions,reportAttributes.dashboard);
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['SUM(Sales)SubCategory'], dashBoardDetails.Dimensions,reportAttributes.dashboard);
                             getKPI(k,analysisArray[k], dashBoardDetails.Measures['AVG(Discount)'], dashBoardDetails.Dimensions,reportAttributes.dashboard);

                       }
                       catch (e) {
                            Analytics.Error = 'Measure Unknown';
                        }

                    }
           }

           function getNaturalLanguage(Analytics, reportAttributes)
           {
            var map = reportAttributes.NLG.map;
            var str = reportAttributes.NLG.template.NLGTemplate;
            var textToReturnArray = [];
            if(reportAttributes.dashboard == "mobile")
            {
                if(Analytics.HighestProfitRegion == Analytics.HighestSalesRegion && Analytics.HighestProfitRegion == Analytics.HighestQuantityRegion )
                {
                   textToReturnArray.push(replaceAll(str,dashBoardDetails.textTemplates.textTemplateSameRegion,map));
                   textToReturnArray.push(replaceAll(str, dashBoardDetails.textTemplates.textTemplateCategory,map));
                   textToReturnArray.push(replaceAll(str,dashBoardDetails.textTemplates.textTemplateOrderDate,map));
                   textToReturnArray.push(replaceAll(str,dashBoardDetails.textTemplates.textTemplateSubCategory,map));

                }
                else
                {
                    textToReturnArray.push(replaceAll(str,dashBoardDetails.textTemplates.textTemplateDifferentRegion,map));
                    textToReturnArray.push(replaceAll(str,dashBoardDetails.textTemplates.textTemplateCategory,map));
                    textToReturnArray.push(replaceAll(str,dashBoardDetails.textTemplates.textTemplateOrderDate,map));
                    textToReturnArray.push(replaceAll(str,dashBoardDetails.textTemplates.textTemplateSubCategory,map));

                }
            }

            if(reportAttributes.dashboard == "SimpleDashboard")
            {
                textToReturn = dashBoardDetails.textTemplates.textTemplateSummary;
                textToReturn = replaceAll(str, textToReturn, map);
            }
            console.log(textToReturnArray);
            return textToReturnArray;
           }
           function replaceAll(searchText, originalData, mapObj){
                var re = new RegExp(searchText,"gi");
                return originalData.replace(re, function(matched){
                    return eval(mapObj[matched]);
                });
            }

           function AnalyzeJSON(analysisArray)
           {
            var g = [];
            getPlaceHolders(dashBoardDetails, analysisArray );
            g = getNaturalLanguage(Analytics, reportAttributes);
            console.log(g);
            for(var i =0;i<g.length;i++)
            {
                console.log(g[i])
                voiceoutput(g[i]);
            }

            //return g;
           }
        function reduceToObjects(cols,data) {
          var fieldNameMap = $.map(cols, function(col) { return col.$0.$1; });
          var dataToReturn = $.map(data, function(d) {
            return d.reduce(function(memo, value, idx) {
                memo[fieldNameMap[idx]] = value.formattedValue; return memo;
                }, {});
            });
          return dataToReturn;
        }


text:
using System;

namespace hmsspx
{
    public class pageListDataSource : pageBase
    {
        public pageListDataSource(Boolean withListView, string url, string breadcrumb):base(withListView)
        {
            // we need this call, if we want to access the SP namespace
            spglb.init(this);
            load(url);

            // Put the StackLayout in a ScrollView.
            Content = base.mainStack;
            string title = breadcrumb + " ListDataSource";
            if( title.Length > pageBase.TitleSize )
                title = title.Substring(title.Length - pageBase.TitleSize);
            setTitle(title);
        }
        private async void load(string url)
        {
            HMS.SP.ListDataSource spListDataSource = await SPGet.getListDataSource(spglb.myClient,url);
            this.add_ListDataSource(1, spListDataSource);
            this.hide_running();
        }
    }
}


text:
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <plurals name="time_minute">
        <item quantity="other">%d minut</item>
        <item quantity="many">%d minut</item>
        <item quantity="few">%d minuty</item>
        <item quantity="one">%d minuta</item>
    </plurals>
</resources>


text:
package coder.blog.db.resume;

import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * Created by Pelin on 16/12/11.
 */
@Data
@Entity
@EqualsAndHashCode(callSuper = false)
@Table(name = "`coder_resumes`")
public class Resume {
}


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

namespace Movimientos.Web.Api.Models
{
    public class Movimiento : Fianza
    {
        public virtual int MovimientoId { get; set; }
    }
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<arquillian xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">

  <container qualifier="jboss" default="true">
    <configuration>
      <property name="jbossHome">target/${jboss.server.name}</property>
      <property name="allowConnectingToRunningServer">false</property>
      <property name="serverConfig">${jboss.server.config.file.name:standalone-full.xml}</property>
    </configuration>
  </container>

</arquillian>


text:
"""
Quick and dirty script to generate test case inputs.
"""
from __future__ import print_function
from os.path import (
    dirname,
    join,
)
from pandas_datareader.data import DataReader

here = join(dirname(__file__))

def main():
    symbols = ['AAPL', 'MSFT', 'BRK-A']
    # Specifically chosen to include the AAPL split on June 9, 2014.
    for symbol in symbols:
        data = DataReader(
            symbol,
            'yahoo',
            start='2014-03-01',
            end='2014-09-01',
        )
        data.rename(
            columns={
                'Open': 'open',
                'High': 'high',
                'Low': 'low',
                'Close': 'close',
                'Volume': 'volume',
            },
            inplace=True,
        )
        del data['Adj Close']

        dest = join(here, symbol + '.csv')
        print("Writing %s -> %s" % (symbol, dest))
        data.to_csv(dest, index_label='day')

if __name__ == '__main__':
    main()


text:
package org.zstack.sdk;

public class DeleteLdapServerResult {

}


text:
package com.jcwhatever.pvs.api.events.region;

import com.jcwhatever.pvs.api.arena.IArena;
import com.jcwhatever.pvs.api.events.AbstractArenaEvent;

/**
 * Called after an arena region is restored.
 */
public class ArenaRegionRestoredEvent extends AbstractArenaEvent {

    /**
     * Constructor.
     *
     * @param arena  The event arena.
     */
    public ArenaRegionRestoredEvent(IArena arena) {
        super(arena);
    }
}


text:
var ChampionCacheRepository = require("../repositories/ChampionCacheRepository");

/**
 * The service for managing champion data
 */
function ChampionCacheService() {
}

/**
 * Caches all the champions
 * @param : callback - the function to call once the operation is complete.
 */
ChampionCacheService.prototype.CacheChampions = function(callback)
{
	ChampionCacheRepository.InvalidateCache(callback);
};

/**
 * Gets all champion data from the cache
 * @param : callback - the function to call once the operation is complete.
 */
ChampionCacheService.prototype.GetAll = function(callback)
{
	ChampionCacheRepository.ReadAll(callback);
};

/**
 * Gets a champions data from the cache by id
 * @param : id - the champions unique id
 * @param : callback - the function to call once the operation is complete.
 */
ChampionCacheService.prototype.GetById = function(id, callback)
{
	ChampionCacheRepository.ReadById(id, callback);
};

/**
 * Links the champion data with the mastery data of a summoner
 * @param : masteries - A summoners champion masteries to be linked with the champion data
 * @param : callback - the function to call once the operation is complete.
 */
ChampionCacheService.prototype.LinkMasteriesToChampions = function(masteries, callback)
{
	var self = this;
	ChampionCacheRepository.ReadAll(function(err, champions){
		var linkedChamps = [];
		for(var i = 0; i < masteries.length; i++){
			for(var j = 0; j < champions.length; j++){
				if(champions[j].id == masteries[i].championId){
					var object = {"Champion": champions[j], "Mastery": masteries[i]};
					linkedChamps.push(object);
					break;
				}
			}
		}

		callback(null, linkedChamps);
	});
};

module.exports = new ChampionCacheService;