text:
import Dataviz, { Dataset } from '../../../lib/browser';

describe('Dataviz', () => {
  let dataviz1;
  let dataviz1NoConfig; // deprecated version of the lib, but still supported

  const config = {
    container: '#some_container',
    type: 'area'
  };

  beforeEach(() => {
    dataviz1 = new Dataviz(config);
    dataviz1NoConfig = new Dataviz();
  });

  afterEach(() => {
    dataviz1 = null;
    dataviz1NoConfig = null;
    Dataviz.visuals = [];
  });

  describe('constructor', () => {

    it('should create a new Dataviz instance', () => {
      expect(dataviz1).toBeInstanceOf(Dataviz);
    });

    it('should contain a new Dataset instance', () => {
      expect(dataviz1.dataset).toBeInstanceOf(Dataset);
    });

    it('should contain a view object', () => {
      expect(dataviz1.view).toBeInstanceOf(Object);
    });

    it('should be appended to Dataviz.visuals', () => {
      expect(Dataviz.visuals.length).toBe(2);
      expect(Dataviz.visuals[0]).toBeInstanceOf(Dataviz);
    });

    it('should set config options', () => {
      expect(dataviz1.config.type).toBe(config.type);
      expect(dataviz1.config.container).toBe(config.container);
    });

    it('should set config options', () => {
      expect(dataviz1.config.type).toBe(config.type);
      expect(dataviz1.config.container).toBe(config.container);
    });

  });

  describe('.attributes()', () => {

    it('should get the current properties', () => {
      expect(dataviz1.attributes()).toBeInstanceOf(Object);
    });

    it('should set a hash of properties', () => {
      dataviz1.attributes({ title: 'Updated Attributes', stacked: true });
      expect(dataviz1.config.title).toEqual('Updated Attributes');
      expect(dataviz1.config.stacked).toEqual(true);
    });

    it('should unset properties by passing null', () => {
      dataviz1.attributes({ stacked: null });
      expect(dataviz1.config.stacked).toBe(null);
    });

  });

  describe('.colors()', () => {

    it('should get the current color set', () => {
      expect(dataviz1.colors()).toBeInstanceOf(Array);
      expect(dataviz1.colors()).toEqual(dataviz1.config.colors);
    });

    it('should set a new array of colors', () => {
      const array = ['red','green','blue'];
      dataviz1.colors(array);
      expect(dataviz1.config.colors).toBeInstanceOf(Array);
      expect(dataviz1.config.colors).toHaveLength(3);
      expect(dataviz1.config.colors).toEqual(array);
    });

    it('should unset the colors set by passing null', () => {
      const array = ['red','green','blue'];
      dataviz1.colors(array);
      dataviz1.colors(null);
      expect(dataviz1.config.colors).toBeInstanceOf(Array);
      expect(dataviz1.config.colors).toHaveLength(0);
    });

  });

  describe('.dateFormat()', () => {
    it('should return undefined by default', () => {
      expect(dataviz1.dateFormat()).toBe(undefined);
    });
    it('should set and get a new dateFormat string', () => {
      dataviz1.dateFormat('test');
      expect(dataviz1.dateFormat()).toEqual('test');
    });
    it('should set and get a new dateFormat function', () => {
      const noop = () => {};
      dataviz1.dateFormat(noop);
      expect(dataviz1.dateFormat()).toEqual(noop);
    });
    it('should unset dateFormat by passing null', () => {
      dataviz1.dateFormat(null);
      expect(dataviz1.dateFormat()).toBe(undefined);
    });
  });

  describe('.colorMapping()', () => {

    it('should return undefined by default', () => {
      expect(dataviz1.colorMapping()).toEqual({});
    });

    it('should set and get a hash of properties', () => {
      const hash = { 'A': '#aaa', 'B': '#bbb' };
      dataviz1.colorMapping(hash);
      expect(dataviz1.config.colorMapping).toEqual(hash);
    });

    it('should unset a property by passing null', () => {
      const hash = { 'A': '#aaa', 'B': '#bbb' };
      dataviz1.colorMapping(hash);
      expect(dataviz1.config.colorMapping.A).toEqual(hash.A);
      dataviz1.colorMapping({ 'A': null });
      expect(dataviz1.config.colorMapping.A)
        .toBe(null);
    });

    it('should reset the configuration by passing null', () => {
      const hash = { 'A': '#aaa', 'B': '#bbb' };
      dataviz1.colorMapping(hash);
      expect(dataviz1.config.colorMapping.A).toEqual(hash.A);
      dataviz1.colorMapping(null);
      expect(dataviz1.config.colorMapping).toEqual({});
    });

  });

  describe('.labels()', () => {

    it('should return an empty array by default', () => {
      expect(dataviz1.labels()).toBeInstanceOf(Array)
      expect(dataviz1.labels()).toHaveLength(0);
    });

    it('should set and get a new array of labels', () => {
      const array = ['A','B','C'];
      dataviz1.labels(array);
      expect(dataviz1.config.labels).toEqual(array);
    });

    it('should unset the labels set by passing null', () => {
      const array = ['A','B','C'];
      dataviz1.labels(array);
      dataviz1.labels(null);
      expect(dataviz1.config.labels).toBeInstanceOf(Array);
      expect(dataviz1.config.labels).toHaveLength(0);
    });

    it('should rewrite the labels in a categorical Dataset instance', () => {
      const array = ['A','B'];
      const ds = new Dataset();
      ds.matrix = [
        ['Index', 'Result'],
        ['Row 1', 1],
        ['Row 2', 2],
        ['Row 3', 3]
      ];
      dataviz1.data(ds).labels(array);
      expect(dataviz1.dataset.selectColumn(0)).toBeInstanceOf(Array);
      expect(dataviz1.dataset.selectColumn(0)).toHaveLength(4);
      expect(dataviz1.dataset.selectColumn(0)).toEqual(['Index', 'A', 'B', 'Row 3']);
    });

    it('should rewrite the labels in a timeseries Dataset instance', () => {
      const array = ['A'];
      const ds = new Dataset();
      ds.matrix = [
        ['Index', 'First', 'Next'],
        ['2012-01-01T12:00:00', 1, 3],
        ['2013-01-01T12:00:00', 2, 2],
        ['2014-01-01T12:00:00', 3, 1]
      ];
      dataviz1.data(ds).labels(array);
      expect(dataviz1.dataset.selectRow(0)).toBeInstanceOf(Array);
      expect(dataviz1.dataset.selectRow(0)).toHaveLength(3);
      expect(dataviz1.dataset.selectRow(0)).toEqual(['Index', 'A', 'Next']);
    });

  });

  describe('.labelMapping()', () => {

    it('should return undefined by default', () => {
      expect(dataviz1.labelMapping()).toEqual({});
    });

    it('should set and get a hash of properties', () => {
      const hash = { '_a_': 'A', '_b_': 'B' };
      dataviz1.labelMapping(hash);
      expect(dataviz1.config.labelMapping).toEqual(hash);
    });

    it('should unset a property by passing null', () => {
      const hash = { '_a_': 'A', '_b_': 'B' };
      dataviz1.labelMapping(hash);
      expect(dataviz1.config.labelMapping._a_).toEqual('A');
      dataviz1.labelMapping({ '_a_': null });
      expect(dataviz1.config.labelMapping._a_).toBe(null);
    });

    it('should reset the configuration by passing null', () => {
      const hash = { _a_: 'A', _b_: 'B' };
      dataviz1.labelMapping(hash);
      expect(dataviz1.config.labelMapping._a_).toEqual('A');
      dataviz1.labelMapping(null);
      expect(dataviz1.config.labelMapping).toEqual({});
    });

    // TODO: re-activate
    it('should rewrite the labels in a categorical Dataset instance', () => {
      const labels = {
        'First': 'A',
        'Row 1': 'A',
        'Row 2': 'B'
      };
      const ds = new Dataset();
      ds.matrix = [
        ['Index', 'Result'],
        ['Row 1', 1],
        ['Row 2', 2],
        ['Row 3', 3]
      ];
      dataviz1.data(ds).labelMapping(labels);
      expect(dataviz1.dataset.selectColumn(0)).toEqual(['Index', 'A', 'B', 'Row 3']);
    });

    it('should rewrite the labels in a timeseries Dataset instance', () => {
      const labels = {
        'First': 'A',
        'Row 2': 'B'
      };
      const ds = new Dataset();
      ds.matrix = [
        ['Index', 'First', 'Next'],
        ['2012-01-01T12:00:00', 1, 3],
        ['2013-01-01T12:00:00', 2, 2],
        ['2014-01-01T12:00:00', 3, 1]
      ];
      dataviz1.data(ds).labelMapping(labels);
      expect(dataviz1.dataset.selectRow(0)).toEqual(['Index', 'A', 'Next']);
    });

  });

  describe('.notes()', () => {

    it('should return undefined by default', () => {
      expect(dataviz1.notes()).toBe(undefined);
    });

    it('should set and get a new notes value', () => {
      dataviz1.notes('test');
      expect(dataviz1.config.notes).toEqual('test');
    });

    it('should unset the notes by passing null', () => {
      dataviz1.notes(null);
      expect(dataviz1.config.notes).toBe(null);
    });

  });

  describe('.title()', () => {

    it('should return undefined by default', () => {
      expect(dataviz1.title()).toBe(undefined);
    });

    it('should set and get a new title', () => {
      const title = 'New Title';
      dataviz1.title(title);
      expect(dataviz1.config.title).toEqual(title);
    });

    it('should unset the title by passing null', () => {
      dataviz1.title(null);
      expect(dataviz1.config.title).toBe(null);
    });

  });

  describe('.library()', () => {

    it('should return \'default\' by default', () => {
      expect(dataviz1.library())
        .toEqual('default');
    });

    it('should set and get a new library', () => {
      const lib = 'nvd3';
      dataviz1.library(lib);
      expect(dataviz1.config.library)
        .toEqual(lib);
    });

    it('should unset the library by passing null', () => {
      dataviz1.library(null);
      expect(dataviz1.config.library)
        .toBe(null);
    });

  });

  describe('.theme()', () => {

    it('should return \'keen-dataviz\' by default', () => {
      expect(dataviz1.theme())
        .toEqual('keen-dataviz');
    });

    it('should set and get a new theme', () => {
      const theme = 'custom';
      dataviz1.theme(theme);
      expect(dataviz1.config.theme)
        .toEqual(theme);
    });

    it('should unset the theme by passing null', () => {
      dataviz1.theme(null);
      expect(dataviz1.config.theme)
        .toBe(null);
    });

  });

  describe('.chartOptions()', () => {

    it('should set and get a hash of properties', () => {
      const hash = { legend: { position: 'none' }, stacked: true };
      dataviz1.chartOptions(hash);
      expect(dataviz1.config.legend)
        .toMatchObject(hash.legend);
      expect(dataviz1.config.stacked)
        .toEqual(true);
    });
  });

  describe('.type()', () => {
    it('should return undefined by default', () => {
      expect(dataviz1NoConfig.type())
        .toBe(undefined);
    });
    it('should set and get a new chartType', () => {
      const chartType = 'magic-pie'
      dataviz1NoConfig.type(chartType);
      expect(dataviz1NoConfig.config.type).toEqual(chartType);
    });
    it('should unset properties by passing null', () => {
      dataviz1.type(null);
      expect(dataviz1NoConfig.config.type)
        .toBe(undefined);
    });
  });

  describe('.indexBy()', () => {

    it('should return \'timeframe.start\' by default', () => {
      expect(dataviz1.indexBy())
        .toEqual('timeframe.start');
    });

    it('should set and get a new indexBy property', () => {
      dataviz1.indexBy('timeframe.end');
      expect(dataviz1.config.indexBy)
        .toEqual('timeframe.end');
    });

    it('should revert the property to default value by passing null', () => {
      dataviz1.indexBy(null);
      expect(dataviz1.config.indexBy)
        .toEqual('timeframe.start');
    });

  });

  describe('.sortGroups()', () => {

    it('should return undefined by default', () => {
      expect(dataviz1.sortGroups())
        .toBe(undefined);
    });

    it('should set and get a new sortGroups property', () => {
      dataviz1.sortGroups('asc');
      expect(dataviz1.config.sortGroups)
        .toEqual('asc');
    });

    it('should unset property by passing null', () => {
      dataviz1.sortGroups(null);
      expect(dataviz1.config.sortGroups)
        .toBe(null);
    });

    it('should sort labels in a categorical Dataset instance', () => {
      const ds = new Dataset();
      ds.matrix = [
        ['Index', 'Result'],
        ['Row 1', 1],
        ['Row 2', 2],
        ['Row 3', 3]
      ];
      dataviz1.data(ds).sortGroups('desc');
      expect(dataviz1.dataset.selectColumn(0))
        .toEqual(['Index', 'Row 3', 'Row 2', 'Row 1']);
    });

    it('should sort labels in a timeseries Dataset instance', () => {
      const ds = new Dataset();
      ds.matrix = [
        ['Index', 'Next', 'First'],
        ['2012-01-01T12:00:00', 3, 3],
        ['2013-01-01T12:00:00', 3, 2],
        ['2014-01-01T12:00:00', 3, 1]
      ];
      dataviz1.data(ds).sortGroups('asc');
      expect(dataviz1.dataset.selectRow(0))
        .toEqual(['Index', 'First', 'Next']);
    });

  });

  describe('.sortIntervals()', () => {

    it('should return undefined by default', () => {
      expect(dataviz1.sortIntervals())
        .toBe(undefined);
    });

    it('should set and get a new sortIntervals property', () => {
      dataviz1.sortIntervals('asc');
      expect(dataviz1.config.sortIntervals)
        .toEqual('asc');
    });

    it('should unset property by passing null', () => {
      dataviz1.sortIntervals(null);
      expect(dataviz1.config.sortIntervals)
        .toBe(null);
    });

    it('should sort intervals in a timeseries Dataset instance', () => {
      const ds = new Dataset();
      ds.matrix = [
        ['Index', 'First', 'Next'],
        ['2012-01-01T12:00:00', 3, 3],
        ['2013-01-01T12:00:00', 3, 2],
        ['2014-01-01T12:00:00', 3, 1]
      ];
      dataviz1.data(ds).sortIntervals('desc');
      expect(dataviz1.dataset.selectColumn(0))
        .toEqual(['Index', '2014-01-01T12:00:00', '2013-01-01T12:00:00', '2012-01-01T12:00:00']);
    });

  });

  describe('.stacked()', () => {

    it('should return false by default', () => {
      expect(dataviz1.stacked())
        .toEqual(false);
    });

    it('should set `stacked` to true by passing true', () => {
      dataviz1.stacked(true);
      expect(dataviz1.config.stacked)
        .toEqual(true);
    });

    it('should set `stacked` to false by passing null', () => {
      dataviz1.stacked(true);
      dataviz1.stacked(null);
      expect(dataviz1.config.stacked)
        .toEqual(false);
    });

  });

});


text:
#ifndef CORTO_ENTITYADMIN_H_
#define CORTO_ENTITYADMIN_H_

typedef
int (*corto_entityWalkAction)(
    void *e,
    void *instance,
    void *userData);

typedef struct corto_entity {
    void *e;
    void *instance;
} corto_entity;

CORTO_SEQUENCE(corto_entitySeq, corto_entity,);

typedef struct corto_entityPerParent {
    corto_entitySeq entities;
    char *parent;
} corto_entityPerParent;

CORTO_SEQUENCE(corto_entityPerParentSeq, corto_entityPerParent,);

#define CORTO_ENTITYADMIN_INIT (corto_entityAdmin){0, 0, UT_RWMUTEX_INIT, 0, 0, UT_MUTEX_INIT, UT_COND_INIT}

/* Threads keep their own copy of active entities so there is no need for
 * a lock when walking the admin */
typedef struct corto_entityAdmin {
    /* Key for accessing local thread copy */
    ut_tls key;

    /* Total number of enitities */
    int count;

    /* Lock for modifying /reading global object */
    ut_rwmutex_s lock;

    /* counter keeps track of when entities are added / removed so that
     * threads know when to sync. */
    uint32_t changed;

    /* Condition variable keeping track of the number of active threads using
     * this entityAdmin. While there are active threads, entities should not be
     * removed. */
    int32_t use_count;
    ut_mutex_s use_count_lock;
    ut_cond_s use_count_cond;

    /* Entity administration */
    corto_entityPerParentSeq entities[CORTO_MAX_SCOPE_DEPTH];
} corto_entityAdmin;

int16_t corto_entityAdmin_claimDepthFromId(
    const char *id);

corto_entityAdmin* corto_entityAdmin_claim(
    corto_entityAdmin *_this);

void corto_entityAdmin_release(
    corto_entityAdmin *_this);

void corto_entityAdmin_wait_for_unused(
    corto_entityAdmin *_this);

int16_t corto_entityAdmin_add(
    corto_entityAdmin *_this,
    const char *parent,
    void *e,
    void *instance);

int corto_entityAdmin_remove(
    corto_entityAdmin *_this,
    const char *parent,
    void *e,
    void *instance,
    bool removeAll);

int corto_entityAdmin_walk(
    corto_entityAdmin *_this,
    corto_entityWalkAction action,
    const char *parent,
    bool recursive,
    void *userData);

void corto_entityAdmin_free(
    void *admin);

void corto_entityAdmin_free_contents(
    corto_entityAdmin *data,
    bool global_admin);

#endif

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Brasa\RecursoHumanoBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\Table(name="rhu_subzona")
 * @ORM\Entity(repositoryClass="Brasa\RecursoHumanoBundle\Repository\RhuSubzonaRepository")
 */
class RhuSubzona
{
     /**
     * @ORM\Id
     * @ORM\Column(name="codigo_subzona_pk", type="integer")
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $codigoSubzonaPk;

    /**
     * @ORM\Column(name="nombre", type="string", length=80, nullable=true)
     */
    private $nombre;

    /**
     * @ORM\OneToMany(targetEntity="RhuEmpleado", mappedBy="subzonaRel")
     */
    protected $empleadosSubzonaRel;

    /**
     * Constructor
     */
    public function __construct()
    {
        $this->empleadosSubzonaRel = new \Doctrine\Common\Collections\ArrayCollection();
    }

    /**
     * Get codigoSubzonaPk
     *
     * @return integer
     */
    public function getCodigoSubzonaPk()
    {
        return $this->codigoSubzonaPk;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     *
     * @return RhuSubzona
     */
    public function setNombre($nombre)
    {
        $this->nombre = $nombre;

        return $this;
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Add empleadosSubzonaRel
     *
     * @param \Brasa\RecursoHumanoBundle\Entity\RhuEmpleado $empleadosSubzonaRel
     *
     * @return RhuSubzona
     */
    public function addEmpleadosSubzonaRel(\Brasa\RecursoHumanoBundle\Entity\RhuEmpleado $empleadosSubzonaRel)
    {
        $this->empleadosSubzonaRel[] = $empleadosSubzonaRel;

        return $this;
    }

    /**
     * Remove empleadosSubzonaRel
     *
     * @param \Brasa\RecursoHumanoBundle\Entity\RhuEmpleado $empleadosSubzonaRel
     */
    public function removeEmpleadosSubzonaRel(\Brasa\RecursoHumanoBundle\Entity\RhuEmpleado $empleadosSubzonaRel)
    {
        $this->empleadosSubzonaRel->removeElement($empleadosSubzonaRel);
    }

    /**
     * Get empleadosSubzonaRel
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getEmpleadosSubzonaRel()
    {
        return $this->empleadosSubzonaRel;
    }
}


text:
import bisect
import os
import sys
EXPORT_RDR = True
try:
    import rosbag
except ImportError, e:
    print 'Failed to import rosbag, not exporting radar'
    EXPORT_RDR = False

sys.path.append('../process')
from GPSReader import GPSReader

class FrameFinder:

    """ Creates a mapping from cloud to frames.
    """

    frame_to_cloud_map = {}
    map_file_path = ""
    map_file_name = ""

    def __init__(self, gps_file, frames_folder, radar_bag_file, write_to_file):
        if frames_folder[-1] == '/':
            frames_folder = frames_folder[0:-1]

        basename = frames_folder.replace('_frames', '')
        self.map_file_name = basename + ".map"

        reader = GPSReader(gps_file)

        # Camera time should already be sorted because frame # always increases
        camera_times = [utc_from_gps(data['week'], data['seconds'])
                        for data in reader.getData()]

        ldr_times = \
            [long(os.path.splitext(os.path.basename(ldr_file))[0])
             for ldr_file in os.listdir(frames_folder)
             if ldr_file.endswith('.ldr')]

        # Need to sort the ldr_times because listdir returns undefined ordering
        ldr_times.sort()

        if EXPORT_RDR:
            rdr_times = unpack_bag(basename, radar_bag_file)

        for frame_number, camera_time in enumerate(camera_times):
            # Find the closest time in ldr times
            nearest_index_ldr = bisect.bisect(ldr_times, camera_time)
            nearest_index_rdr = -1
            if EXPORT_RDR:
                nearest_index_rdr = bisect.bisect(rdr_times, camera_time)

            if nearest_index_ldr >= 1 and (not EXPORT_RDR or nearest_index_rdr >=1):
                lidr_file = str(ldr_times[nearest_index_ldr - 1]) + '.ldr'
                if EXPORT_RDR:
                    radar_seq = str(rdr_times[nearest_index_rdr - 1]) + '.rdr'

                # Frames are indexed by 1, not
                real_frame = frame_number + 1

                if EXPORT_RDR:
                    self.frame_to_cloud_map[real_frame] = (lidr_file, radar_seq)
                else:
                    self.frame_to_cloud_map[real_frame] = lidr_file
                #print real_frame, (lidr_file, radar_seq)
        if write_to_file:
            self.__write_frame_map()

    def get_map(self):
        """ Returns a mapping from camera frame to ldr file """
        return self.frame_to_cloud_map

    def __write_frame_map(self):
        """ Writes the camera frame to ldr file mapping to a file """
        out_file = open(self.map_file_name, 'w')
        for frame, data in self.get_map().iteritems():
            line = str(frame) + ' ' + str(data[0])
            if EXPORT_RDR:
                line = str(frame) + ' ' + str(data[0]) + ' ' + str(data[1])
            else:
                line = str(frame) + ' ' + data
            line += '\n'
            out_file.write(line)
        out_file.close()

def utc_from_gps(gps_week, seconds, leap_seconds=16):
    """ Converts from gps week time to UTC time. UTC time starts from JAN 1,
        1970 and GPS time starts from JAN 6, 1980.

        http://leapsecond.com/java/gpsclock.htm
    """

    secs_in_week = 604800
    secs_gps_to_utc = 315964800

    return long((gps_week * secs_in_week + seconds + secs_gps_to_utc
                - leap_seconds) * 1000000)

def unpack_bag(basename, radar_bag_file):
    """ Unpacks the bag and writes individual segments to files.
    The ouput folder is the basename + _rdr.
    Each file name is the time of the starting segment
    """
    radar_bag = rosbag.Bag(radar_bag_file)
    times = []
    cur_file = None
    rdr_dir = basename + '_rdr/'
    if not os.path.exists(rdr_dir):
        os.mkdir(rdr_dir)
    for topic, msg, t in radar_bag.read_messages(topics=['/object_list', '/target_status']):
        if msg.obj_id == 61:
            if cur_file != None:
                cur_file.close()
            time = msg.header.stamp.to_nsec()/1000 - 66000
            times.append(time)
            cur_file = open(rdr_dir + str(time) + '.rdr', 'w')

        if cur_file != None:
            if msg.obj_id == 0 or msg.obj_id == 62:
                continue
            line = None
            if topic == '/object_list':
                if msg.isMeasurd == True:
                    fmt = 'O {id} {dist} {lat_dist} {rel_spd} {dyn_prop} {rcs} {w} {l}'
                    line = fmt.format(
                        id = msg.obj_id,
                        dist = msg.dist,
                        lat_dist = msg.lat_dist,
                        rel_spd = msg.relative_spd,
                        dyn_prop = msg.dyn_prop,
                        rcs = msg.rcs,
                        w = msg.width,
                        l = msg.length)
            else:
                if msg.status > 0:
                    fmt = 'T {id} {dist} {lat_dist} {rel_spd} {dyn_prop} {traj} {w} {l} {obst_probab} {exist_probab} {rel_acc} {type} {lost_reason}'
                    line = fmt.format(
                        id = msg.obj_id,
                        dist = msg.dist,
                        lat_dist = msg.lat_dist,
                        rel_spd = msg.relative_spd,
                        dyn_prop = msg.dyn_prop,
                        traj = msg.traj,
                        w = msg.width,
                        l = msg.length,
                        obst_probab = msg.obst_probab,
                        exist_probab = msg.exist_probab,
                        rel_acc = msg.relative_acc,
                        type = msg.type,
                        lost_reason = msg.lost_reason
                        )
            if line != None:
                cur_file.write(line + '\n')
    times.sort()
    return times

def main():
    """ Prints out times
    """

    if len(sys.argv) != 4:
        print """
        Usage: ./FrameFinder.py <gps_output_file> <ldr_folder_directory> <radar_bag_file>
        """
        sys.exit()

    gps_file = sys.argv[1]
    frames_folder = sys.argv[2]
    radar_folder = sys.argv[3]

    FrameFinder(gps_file, frames_folder, radar_folder, write_to_file=True)

if __name__ == '__main__':
    main()


text:
from bridge.model.attributes import  Attributes, BinaryAttribute, IntegerAttribute, ASCIIAttribute, ByteAttribute
from bridge.model.assets.basic_assets import OnOffAsset

class GenericUPBAsset(OnOffAsset):
    def __init__(self, name, real_id, service):
        super().__init__(name, real_id, service, "Generic UPB Device")
        self.attributes.add(
                IntegerAttribute("Level", 0, 101),
                ByteAttribute("Network ID"),
                ByteAttribute("Unit ID"),
                ASCIIAttribute("Network Password", 4),
                ByteAttribute("UBP Options"),
                ByteAttribute("UPB Version"),
                IntegerAttribute("Manufacture ID", 0, 65536),
                IntegerAttribute("Product ID", 0, 65536),
                IntegerAttribute("Firmware Version", 0, 65536),
                IntegerAttribute("Serial Number", 0, 4294967296),
                ASCIIAttribute("Network Name", 16),
                ASCIIAttribute("Room Name", 16),
                ASCIIAttribute("Device Name", 16))


text:
package com.android.inputmethod.latin.makedict;

import com.android.inputmethod.latin.BinaryDictionary;

import java.util.ArrayList;
import java.util.Arrays;

import com.udmurtlyk.extrainputmethod.annotations.UsedForTesting;
import com.android.inputmethod.latin.utils.CombinedFormatUtils;
import com.android.inputmethod.latin.utils.StringUtils;

/**
 * Utility class for a word with a probability.
 *
 * This is chiefly used to iterate a dictionary.
 */
public final class WordProperty implements Comparable<WordProperty> {
    public final String mWord;
    public final ProbabilityInfo mProbabilityInfo;
    public final ArrayList<WeightedString> mShortcutTargets;
    public final ArrayList<WeightedString> mBigrams;
    // TODO: Support mIsBeginningOfSentence.
    public final boolean mIsBeginningOfSentence;
    public final boolean mIsNotAWord;
    public final boolean mIsBlacklistEntry;
    public final boolean mHasShortcuts;
    public final boolean mHasBigrams;

    private int mHashCode = 0;

    @UsedForTesting
    public WordProperty(final String word, final ProbabilityInfo probabilityInfo,
            final ArrayList<WeightedString> shortcutTargets,
            final ArrayList<WeightedString> bigrams,
            final boolean isNotAWord, final boolean isBlacklistEntry) {
        mWord = word;
        mProbabilityInfo = probabilityInfo;
        mShortcutTargets = shortcutTargets;
        mBigrams = bigrams;
        mIsBeginningOfSentence = false;
        mIsNotAWord = isNotAWord;
        mIsBlacklistEntry = isBlacklistEntry;
        mHasBigrams = bigrams != null && !bigrams.isEmpty();
        mHasShortcuts = shortcutTargets != null && !shortcutTargets.isEmpty();
    }

    private static ProbabilityInfo createProbabilityInfoFromArray(final int[] probabilityInfo) {
      return new ProbabilityInfo(
              probabilityInfo[BinaryDictionary.FORMAT_WORD_PROPERTY_PROBABILITY_INDEX],
              probabilityInfo[BinaryDictionary.FORMAT_WORD_PROPERTY_TIMESTAMP_INDEX],
              probabilityInfo[BinaryDictionary.FORMAT_WORD_PROPERTY_LEVEL_INDEX],
              probabilityInfo[BinaryDictionary.FORMAT_WORD_PROPERTY_COUNT_INDEX]);
    }

    // Construct word property using information from native code.
    // This represents invalid word when the probability is BinaryDictionary.NOT_A_PROBABILITY.
    public WordProperty(final int[] codePoints, final boolean isNotAWord,
            final boolean isBlacklisted, final boolean hasBigram, final boolean hasShortcuts,
            final boolean isBeginningOfSentence, final int[] probabilityInfo,
            final ArrayList<int[]> bigramTargets, final ArrayList<int[]> bigramProbabilityInfo,
            final ArrayList<int[]> shortcutTargets,
            final ArrayList<Integer> shortcutProbabilities) {
        mWord = StringUtils.getStringFromNullTerminatedCodePointArray(codePoints);
        mProbabilityInfo = createProbabilityInfoFromArray(probabilityInfo);
        mShortcutTargets = new ArrayList<>();
        mBigrams = new ArrayList<>();
        mIsBeginningOfSentence = isBeginningOfSentence;
        mIsNotAWord = isNotAWord;
        mIsBlacklistEntry = isBlacklisted;
        mHasShortcuts = hasShortcuts;
        mHasBigrams = hasBigram;

        final int bigramTargetCount = bigramTargets.size();
        for (int i = 0; i < bigramTargetCount; i++) {
            final String bigramTargetString =
                    StringUtils.getStringFromNullTerminatedCodePointArray(bigramTargets.get(i));
            mBigrams.add(new WeightedString(bigramTargetString,
                    createProbabilityInfoFromArray(bigramProbabilityInfo.get(i))));
        }

        final int shortcutTargetCount = shortcutTargets.size();
        for (int i = 0; i < shortcutTargetCount; i++) {
            final String shortcutTargetString =
                    StringUtils.getStringFromNullTerminatedCodePointArray(shortcutTargets.get(i));
            mShortcutTargets.add(
                    new WeightedString(shortcutTargetString, shortcutProbabilities.get(i)));
        }
    }

    public int getProbability() {
        return mProbabilityInfo.mProbability;
    }

    private static int computeHashCode(WordProperty word) {
        return Arrays.hashCode(new Object[] {
                word.mWord,
                word.mProbabilityInfo,
                word.mShortcutTargets.hashCode(),
                word.mBigrams.hashCode(),
                word.mIsNotAWord,
                word.mIsBlacklistEntry
        });
    }

    /**
     * Three-way comparison.
     *
     * A Word x is greater than a word y if x has a higher frequency. If they have the same
     * frequency, they are sorted in lexicographic order.
     */
    @Override
    public int compareTo(final WordProperty w) {
        if (getProbability() < w.getProbability()) return 1;
        if (getProbability() > w.getProbability()) return -1;
        return mWord.compareTo(w.mWord);
    }

    /**
     * Equality test.
     *
     * Words are equal if they have the same frequency, the same spellings, and the same
     * attributes.
     */
    @Override
    public boolean equals(Object o) {
        if (o == this) return true;
        if (!(o instanceof WordProperty)) return false;
        WordProperty w = (WordProperty)o;
        return mProbabilityInfo.equals(w.mProbabilityInfo) && mWord.equals(w.mWord)
                && mShortcutTargets.equals(w.mShortcutTargets) && mBigrams.equals(w.mBigrams)
                && mIsNotAWord == w.mIsNotAWord && mIsBlacklistEntry == w.mIsBlacklistEntry
                && mHasBigrams == w.mHasBigrams && mHasShortcuts && w.mHasBigrams;
    }

    @Override
    public int hashCode() {
        if (mHashCode == 0) {
            mHashCode = computeHashCode(this);
        }
        return mHashCode;
    }

    @UsedForTesting
    public boolean isValid() {
        return getProbability() != BinaryDictionary.NOT_A_PROBABILITY;
    }

    @Override
    public String toString() {
        return CombinedFormatUtils.formatWordProperty(this);
    }
}


text:
package bsp1;

import client.Client;

public class ClientConsoleStarter {

	/**
	 * @param args
	 */
public static void main(String[] args) {

		try{
			Client c = new Client(Integer.valueOf(args[0]).intValue(),args[1],Integer.valueOf(args[2]).intValue(),Integer.valueOf(args[3]).intValue());
		} catch(Exception e) {
			System.out.println("Usage: ServerConsoleStarter ClientUDPPort ServerHost ServerTCPPort ServerUDPPort");
			System.err.println("[ClientConsoleStarter]: Error while retrieving the arguments:"+e);
			System.exit(0);
		}
	}

}


text:
var config = {
  apiKey: "AIzaSyDnvHoVZ3CtyZNywVwuQ1P72nylKnRZd58",
  authDomain: "jsd-test-1.firebaseapp.com",
  databaseURL: "https://jsd-test-1.firebaseio.com",
  storageBucket: "jsd-test-1.appspot.com",
};

firebase.initializeApp(config);


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

namespace ElectronicObserver.Data {

	/// <summary>
	/// 艦種
	/// </summary>
	[DebuggerDisplay( "[{ID}] : {Name}" )]
	public class ShipType : ResponseWrapper, IIdentifiable {

		/// <summary>
		/// 艦種
		/// </summary>
		public int TypeID {
			get { return (int)RawData.api_id; }
		}

		/// <summary>
		/// 並べ替え順
		/// </summary>
		public int SortID {
			get { return (int)RawData.api_sortno; }
		}

		/// <summary>
		/// 艦種名
		/// </summary>
		public string Name {
			get { return RawData.api_name; }
		}

		/// <summary>
		/// 入渠時間係数
		/// </summary>
		public int RepairTime {
			get { return (int)RawData.api_scnt; }
		}

		//TODO: api_kcnt

		/// <summary>
		/// 装備可否フラグ
		/// </summary>
		private Dictionary<int, bool> _equipmentType;
		public ReadOnlyDictionary<int, bool> EquipmentType {
			get { return new ReadOnlyDictionary<int, bool>( _equipmentType ); }
		}

		public int ID {
			get { return TypeID; }
		}

		public ShipType()
			: base() {

			_equipmentType = new Dictionary<int, bool>();
		}

		public override void LoadFromResponse( string apiname, dynamic data ) {
			base.LoadFromResponse( apiname, (object)data );

			//注:jsonの命名規則に違反するkeyを持っていて読み込めないので、決め打ちで読み込む
			if ( IsAvailable ) {
				int i = 1;
				_equipmentType = new Dictionary<int, bool>();
				foreach ( KeyValuePair<string, object> type in RawData.api_equip_type ) {
					_equipmentType.Add( i, (double)type.Value != 0 );
					i++;
				}
			}
		}

	}

}


text:
CGFloat BKScreenScale() {
    static CGFloat scale;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        scale = [UIScreen mainScreen].scale;
    });
    return scale;
}

CGSize BKScreenSize() {
    static CGSize size;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        size = [UIScreen mainScreen].bounds.size;
        if (size.height < size.width) {
            CGFloat tmp = size.height;
            size.height = size.width;
            size.width = tmp;
        }
    });
    return size;
}


text:
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'redux/react';
import Counter from '../components/Counter';
import * as CounterActions from '../actions/CounterActions';

@connect(state => ({
  counter: state.counter
}))
export default class CounterApp {
  render() {
    const { counter, dispatch } = this.props;

    return (
      <Counter counter={counter}
               {...bindActionCreators(CounterActions, dispatch)}
      />
    );
  }
}


text:
export default {
  name: 'v-stepper-content',

  data () {
    return {
      height: 0,
      isActive: false,
      isReverse: false,
      isVertical: false
    }
  },

  props: {
    step: {
      type: [Number, String],
      required: true
    }
  },

  computed: {
    classes () {
      return {
        'stepper__content': true
      }
    },
    computedTransition () {
      return this.isReverse
        ? 'v-tab-reverse-transition'
        : 'v-tab-transition'
    },
    styles () {
      if (!this.isVertical) return {}

      return {
        height: !isNaN(this.height) ? `${this.height}px` : this.height
      }
    },
    wrapperClasses () {
      return {
        'stepper__wrapper': true
      }
    }
  },

  watch: {
    isActive () {
      if (!this.isVertical) {
        return
      }

      if (this.isActive) {
        this.enter()
      } else {
        this.leave()
      }
    }
  },

  mounted () {
    this.$refs.wrapper.addEventListener(
      'transitionend',
      this.onTransition,
      false
    )
  },

  beforeDestroy () {
    this.$refs.wrapper.removeEventListener(
      'transitionend',
      this.onTransition,
      false
    )
  },

  methods: {
    onTransition () {
      if (!this.isActive) return

      this.height = 'auto'
    },
    enter () {
      let scrollHeight = 0

      // Render bug with height
      setTimeout(() => {
        scrollHeight = this.$refs.wrapper.scrollHeight
      }, 0)

      this.height = 0

      // Give the collapsing element time to collapse
      setTimeout(() => (this.height = (scrollHeight || 'auto')), 450)
    },
    leave () {
      this.height = this.$refs.wrapper.clientHeight
      setTimeout(() => (this.height = 0), 0)
    },
    toggle (step, reverse) {
      this.isActive = step.toString() === this.step.toString()
      this.isReverse = reverse
    }
  },

  render (h) {
    const contentData = {
      'class': this.classes
    }
    const wrapperData = {
      'class': this.wrapperClasses,
      style: this.styles,
      ref: 'wrapper'
    }

    if (!this.isVertical) {
      contentData.directives = [{
        name: 'show',
        value: this.isActive
      }]
    }

    const wrapper = h('div', wrapperData, [this.$slots.default])
    const content = h('div', contentData, [wrapper])

    return h(this.computedTransition, {
      on: this.$listeners
    }, [content])
  }
}


text:
"""

  Coins grid problem in Google CP Solver.

  Problem from
  Tony Hurlimann: "A coin puzzle - SVOR-contest 2007"
  http://www.svor.ch/competitions/competition2007/AsroContestSolution.pdf
  '''
  In a quadratic grid (or a larger chessboard) with 31x31 cells, one should
  place coins in such a way that the following conditions are fulfilled:
     1. In each row exactly 14 coins must be placed.
     2. In each column exactly 14 coins must be placed.
     3. The sum of the quadratic horizontal distance from the main diagonal
        of all cells containing a coin must be as small as possible.
     4. In each cell at most one coin can be placed.
  The description says to place 14x31 = 434 coins on the chessboard each row
  containing 14 coins and each column also containing 14 coins.
  '''

  This is a MIP version of
     http://www.hakank.org/google_or_tools/coins_grid.py
  and use

  This model was created by Hakan Kjellerstrand (hakank@bonetmail.com)
  Also see my other Google CP Solver models:
  http://www.hakank.org/google_or_tools/
"""

from ortools.linear_solver import pywraplp

def main(unused_argv):

  # Create the solver.

  # using CBC
  solver = pywraplp.Solver('CoinsGridCBC',
                           pywraplp.Solver.CBC_MIXED_INTEGER_PROGRAMMING)

  # Using CLP
  # solver = pywraplp.Solver('CoinsGridCLP',
  #                          pywraplp.Solver.CBC_MIXED_INTEGER_PROGRAMMING)

  # data
  n = 31  # the grid size
  c = 14  # number of coins per row/column

  # declare variables
  x = {}
  for i in range(n):
    for j in range(n):
      x[(i, j)] = solver.IntVar(0, 1, 'x[%i,%i]' % (i, j))

  #
  # constraints
  #

  # sum rows/columns == c
  for i in range(n):
    solver.Add(solver.Sum(
        [x[(i, j)] for j in range(n)]) == c)      # sum rows
    solver.Add(solver.Sum(
        [x[(j, i)] for j in range(n)]) == c)  # sum cols

  # quadratic horizonal distance var
  objective_var = solver.Sum(
      [x[(i, j)] * (i - j) * (i - j)
       for i in range(n) for j in range(n)])

  # objective
  objective = solver.Minimize(objective_var)

  #
  # solution and search
  #
  solver.Solve()

  for i in range(n):
    for j in range(n):
      # int representation
      print int(x[(i, j)].SolutionValue()),
    print
  print

  print
  print 'walltime  :', solver.WallTime(), 'ms'
  # print 'iterations:', solver.Iterations()

if __name__ == '__main__':
  main('coin grids')


text:
@interface UIFont (Stoke)

+ (instancetype)stokeLightFontOfSize:(CGFloat)size;
+ (instancetype)stokeRegularFontOfSize:(CGFloat)size;

@end


text:
package com.soundcloud.lightcycle.sample.basic;

import com.soundcloud.lightcycle.DefaultActivityLightCycle;

import android.os.Bundle;
import android.util.Log;

import androidx.appcompat.app.AppCompatActivity;

class ActivityLogger extends DefaultActivityLightCycle<AppCompatActivity> {

    private static final String TAG = "ACTIVITY_LOG";

    @Override
    public void onCreate(AppCompatActivity activity, Bundle bundle) {
        Log.i(TAG, "Creating activity:" + activity);
    }

    @Override
    public void onStart(AppCompatActivity activity) {
        Log.i(TAG, "Starting activity:" + activity);
    }

    @Override
    public void onResume(AppCompatActivity activity) {
        Log.i(TAG, "Resuming activity:" + activity);
    }

    @Override
    public void onPause(AppCompatActivity activity) {
        Log.i(TAG, "Pausing activity:" + activity);
    }

    @Override
    public void onStop(AppCompatActivity activity) {
        Log.i(TAG, "Stopping activity:" + activity);
    }

    @Override
    public void onDestroy(AppCompatActivity activity) {
        Log.i(TAG, "Destroying activity:" + activity);
    }
}


text:
{{selectedDoc.title}}

				Edit

			Edit

				<ng-include src="'/views/files.html'" ></ng-include>

		<button class="pull-right btn btn-danger"
			ng-click="delete()">

		</button>

Created on {{selectedDoc.created | date : 'MMM d, y h:mm a' }} by {{selectedDoc.author}}


text:
/*
 * FRC Team 4343
 * Visit us at www.4343.ca
 */
package ca._4343.max3.commands.launcher;

import ca._4343.max3.commands.CommandBase;

/**
 * Default command for launcher subsystem. Causes the launcher
 * motor to stop when it is not in use.
 * @author Brian Ho <www.4343.ca>
 * @author Tedi Papajorgji <www.4343.ca>
 */
public class LauncherDoNothing extends CommandBase {

    public LauncherDoNothing() {
        requires(launcher);
    }

    /**
     * Called just before this Command runs the first time
     */
    protected void initialize() {
    }

    /**
     * Called repeatedly when this Command is scheduled to run
     * Stops the launcher motor from winding
     */
    protected void execute() {
        launcher.stop();
    }

    /**
     * Always returns false because it is the default command
     * of the launcher subsystem
     * @return False ALWAYS
     */
    protected boolean isFinished() {
        return false;
    }

    /**
     * Called once after isFinished returns true
     */
    protected void end() {
    }

    /**
     * Called when another command which requires one or more of the same
     * subsystems is scheduled to run
     */
    protected void interrupted() {
    }
}


text:
START_ATF_NAMESPACE
    struct _DLLVERSIONINFO
    {
        unsigned int cbSize;
        unsigned int dwMajorVersion;
        unsigned int dwMinorVersion;
        unsigned int dwBuildNumber;
        unsigned int dwPlatformID;
    };
END_ATF_NAMESPACE


text:
"""
Test computation of resolution matrix for LCMV beamformers.

If noise and data covariance are the same, the LCMV beamformer weights should
be the transpose of the leadfield matrix.
"""

from copy import deepcopy
import os.path as op
import numpy as np
from numpy.testing import assert_allclose

import mne
from mne.datasets import testing
from mne.beamformer import make_lcmv, make_lcmv_resolution_matrix

data_path = testing.data_path(download=False)
subjects_dir = op.join(data_path, 'subjects')
fname_inv = op.join(data_path, 'MEG', 'sample',
                    'sample_audvis_trunc-meg-eeg-oct-6-meg-inv.fif')
fname_evoked = op.join(data_path, 'MEG', 'sample',
                       'sample_audvis_trunc-ave.fif')
fname_raw = op.join(data_path, 'MEG', 'sample', 'sample_audvis_trunc_raw.fif')
fname_fwd = op.join(data_path, 'MEG', 'sample',
                    'sample_audvis_trunc-meg-eeg-oct-4-fwd.fif')
fname_cov = op.join(data_path, 'MEG', 'sample', 'sample_audvis_trunc-cov.fif')

@testing.requires_testing_data
def test_resolution_matrix_lcmv():
    """Test computation of resolution matrix for LCMV beamformers."""
    # read forward solution
    forward = mne.read_forward_solution(fname_fwd)

    # remove bad channels
    forward = mne.pick_channels_forward(forward, exclude='bads')

    # forward operator with fixed source orientations
    forward_fxd = mne.convert_forward_solution(forward, surf_ori=True,
                                               force_fixed=True)

    # evoked info
    info = mne.io.read_info(fname_evoked)
    mne.pick_info(info, mne.pick_types(info, meg=True), copy=False)  # good MEG

    # noise covariance matrix
    # ad-hoc to avoid discrepancies due to regularisation of real noise
    # covariance matrix
    noise_cov = mne.make_ad_hoc_cov(info)

    # Resolution matrix for Beamformer
    data_cov = noise_cov.copy()  # to test a property of LCMV

    # compute beamformer filters
    # reg=0. to make sure noise_cov and data_cov are as similar as possible
    filters = make_lcmv(info, forward_fxd, data_cov, reg=0.,
                        noise_cov=noise_cov,
                        pick_ori=None, rank=None,
                        weight_norm=None,
                        reduce_rank=False,
                        verbose=False)

    # Compute resolution matrix for beamformer
    resmat_lcmv = make_lcmv_resolution_matrix(filters, forward_fxd, info)

    # for noise_cov==data_cov and whitening, the filter weights should be the
    # transpose of leadfield

    # create filters with transposed whitened leadfield as weights
    forward_fxd = mne.pick_channels_forward(forward_fxd, info['ch_names'])
    filters_lfd = deepcopy(filters)
    filters_lfd['weights'][:] = forward_fxd['sol']['data'].T

    # compute resolution matrix for filters with transposed leadfield
    resmat_fwd = make_lcmv_resolution_matrix(filters_lfd, forward_fxd, info)

    # pairwise correlation for rows (CTFs) of resolution matrices for whitened
    # LCMV beamformer and transposed leadfield should be 1
    # Some rows are off by about 0.1 - not yet clear why
    corr = []

    for (f, l) in zip(resmat_fwd, resmat_lcmv):

        corr.append(np.corrcoef(f, l)[0, 1])

    # all row correlations should at least be above ~0.8
    assert_allclose(corr, 1., atol=0.2)

    # Maximum row correlation should at least be close to 1
    assert_allclose(np.max(corr), 1., atol=0.01)


text:
METADATA_HOST=rancher-metadata.rancher.internal
METADATA_VERSION=2015-12-19
METADATA=$METADATA_HOST/$METADATA_VERSION
function metadata { echo $(curl -s $METADATA/$1); }
###############################################################################

PRINCIPAL=${PRINCIPAL:-root}
ZK_SERVICE=${ZK_SERVICE:-"mesos/zk"}
MESOS_SERVICE=${MESOS_SERVICE:="mesos/mesos"}

function zk_service {
  IFS='/' read -ra ZK <<< "$ZK_SERVICE"
  echo $(metadata stacks/${ZK[0]}/services/${ZK[1]}/$1)
}

if [ "$(zk_service containers)" == "Not found" ]; then
  echo "A zookeeper ensemble is required, but '$ZK_SERVICE' was not found."
  sleep 1 && exit 1
fi

function zk_container_primary_ip {
  IFS='=' read -ra c <<< "$1"
  echo $(zk_service containers/${c[1]}/primary_ip)
}

function zk_string {
  ZK_STRING=
  for container in $(zk_service containers); do
    ip=$(zk_container_primary_ip $container)
    if [ "$ZK_STRING" == "" ]; then
      ZK_STRING=zk://$ip:2181
    else
      ZK_STRING=$ZK_STRING,$ip:2181
    fi
  done
  echo ${ZK_STRING}
}

function mesos_stack {
  IFS='/' read -ra X <<< "$MESOS_SERVICE"
  echo ${X[0]}
}

zk=$(zk_string)
export MARATHON_MASTER=$zk/$(mesos_stack)
export MARATHON_ZK=$zk/$(metadata self/stack/name)
export MARATHON_HOSTNAME=$(metadata self/container/primary_ip)
export MARATHON_FRAMEWORK_NAME=$(metadata self/stack/name)

### dunno how to use this ###
if [ -n "$SECRET" ]; then
    export MARATHON_MESOS_AUTHENTICATION_PRINCIPAL=${MARATHON_MESOS_AUTHENTICATION_PRINCIPAL:-$PRINCIPAL}
    touch /tmp/secret
    chmod 600 /tmp/secret
    echo -n "$SECRET" > /tmp/secret
    export MARATHON_MESOS_AUTHENTICATION_SECRET_FILE=/tmp/secret
fi
### / dunno how to use this ###

marathon "$@"


text:
import { Template } from 'meteor/templating';
import { OHIF } from 'meteor/ohif:core';

Template.studyTimepoint.onCreated(() => {
    const instance = Template.instance();
    const data = instance.data;

    instance.isActive = {};
    if (data.isUnassociatedStudy === true && data.studyInstanceUids.length === 1) {
        instance.isActive[data.studyInstanceUids[0]] = true;
    }
});

// Initialize the timepoint wrapper max-height to enable CSS transition
Template.studyTimepoint.onRendered(() => {
    const instance = Template.instance();

    const $studies = instance.$('.studyTimepoint');
    const $wrapper = $studies.closest('.studyTimepointWrapper');
    const $timepoint = $wrapper.closest('.timepointEntry');
    const studiesVisible = $studies.is(':visible');

    if (!studiesVisible) {
        $timepoint.addClass('active');
    }

    // Recalculates the timepoint height to make CSS transition smoother
    $studies.trigger('displayStateChanged');

    if (!studiesVisible) {
        $timepoint.removeClass('active');
    }
});

Template.studyTimepoint.events({
    // Changes the selected study
    'selectionChanged .studyTimepoint'(event, instance, changed) {
        const $selection = $(changed.selection);

        // Defines where will be the studies searched
        let $studiesTarget = instance.$('.studyTimepoint');

        // @TypeSafeStudies
        if (changed.isQuickSwitch) {
            // Changes the current quick switch study
            const study = OHIF.viewer.Studies.findBy({
                studyInstanceUid: changed.studyInstanceUid
            });
            instance.data.currentStudy.set(study);

            // Changes the target to toggle the selection in all the studies
            $studiesTarget = $studiesTarget.closest('.studyTimepointBrowser');
        }

        // Removes selected state from all studies but the triggered study
        $studiesTarget.find('.studyTimepointStudy').not($selection).removeClass('active');

        if (changed.isQuickSwitch) {
            // Reset active studies map to allow only one active study
            instance.isActive = {};
            // Add selected state for the triggered study
            $selection.addClass('active');
        } else {
            const $timepoint = instance.$('.studyTimepoint');
            // Set the max-height to inherit to be able to expand the wrapper on its full height
            instance.$('.studyTimepointWrapper').css('max-height', 'inherit');
            // Toggle selected state for the triggered study
            $selection.removeClass('loading');
            $selection.toggleClass('active');
            // Recalculates the timepoint height to make CSS transition smoother
            const $thumbnails = $selection.find('.studyTimepointThumbnails');
            $thumbnails.one('transitionend', () => $timepoint.trigger('displayStateChanged'));
        }

        // Set the current study as active
        instance.isActive[changed.studyInstanceUid] = $selection.hasClass('active');
    },
    // It should be triggered when the timepoint height is changed
    'displayStateChanged .studyTimepoint'(event, instance) {
        const $timepoint = $(event.currentTarget);
        const $wrapper = $timepoint.closest('.studyTimepointWrapper');

        // Set the max-height for the wrapper to make CSS transition smoother
        $wrapper.css('max-height', $timepoint.height());
    }
});

Template.studyTimepoint.helpers({
    isActive(study) {
        const instance = Template.instance();

        if (!study.studyInstanceUid) {
            return;
        }

        return instance.isActive[study.studyInstanceUid];
    }
});


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:orientation="vertical"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:padding="5dip">
    <TextView
            android:id="@+id/name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="20sp"
            android:layout_marginTop="5dp"
            android:layout_marginBottom="10dip"/>
    <TextView
            android:id="@+id/path"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="16sp"
            android:layout_marginBottom="10dip"/>
    <TextView
            android:id="@+id/process"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textSize="16sp"
            android:layout_marginBottom="10dip"/>
    <ProgressBar
            android:id="@+id/bar"
            style="?android:attr/progressBarStyleHorizontal"
            android:layout_width="match_parent"
            android:max="100"
            android:layout_height="5dip"
            android:layout_marginBottom="10dp"
    />
    <Button
            android:id="@+id/btn"
            android:textSize="22sp"
            android:enabled="true"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"/>
</LinearLayout>


text:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Drawing.Imaging;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Geb.Image
{
    using TPixel = Bgra32;
    using TChannel = System.Byte;
    using TCache = System.Int32;
    using TKernel = System.Int32;
    using TImage = Geb.Image.ImageBgra32;

    public static partial class ImageBgra32ClassHelper
    {
        #region include "__ImageClassHelper_Template.cs"
        #endregion
    }

    public partial class ImageBgra32
    {
        #region include "__Image_Template.cs" [Image_Template -> ImageBgra32]
        #endregion

        #region include "__Paramid_Templete.cs"
        #endregion
    }

    public partial struct Bgra32
    {
        #region include "__Pixel_Template.cs"
        #endregion
    }
}


text:
<TITLE>Review for Armageddon (1998)</TITLE>
<LINK REL="STYLESHEET" TYPE="text/css" HREF="/ramr.css">

Armageddon (1998)

reviewed by
Mikel J. Koven

Review by Mikel J. Koven
The following review was published in The Express, St. John's
Newfoundland, 8 July, 1998.
Copyright 1998, by the author.

Armageddon (1998)

     Armageddon may very well be the biggest movie scheduled to open
this summer.  Touchstone Studios (i.e. Disney) have obviously banked a
lot of money on this flick, and perhaps I am just getting cynical after
The X-Files debacle, but it strikes me that we as movie audiences are
becoming more and more susceptible to studio marketing hype than ever
before.  No matter how bad Armageddon is, and it is pretty awful, thrill
seekers are going to line up for miles and days in order to watch the
destruction.
     Here is the plot of Armageddon: a big meteor is headed for earth.
This rock, referred to by the scientists in the flick as "a global
killer" will destroy every living thing on earth unless it is
destroyed.  The only hope for humanity is to land a crew of American
(naturally) deep-core drillers on the asteroid and blow it up with
nuclear weapons.
     Bruce Willis plays Harry S. Stamper, a rogue deep-core driller, who
is the best in his trade.  He is brought on by NASA to advise a team of
astronauts taking care of this mission.  Obviously, Stamper cannot trust
a bunch of strangers, and he assembles his own motley crew of
meteor-killers.  The boys blast off, blow-up the rock, and return as
heroes.
     What I think is most noxious about this movie is the absolutely
shameless flag waving: if you were bothered by the "rah, rah!  USA,
A-OK!" sentiments of Independence Day, you can certainly miss this
movie.  Every dramatic moment in the film has the "stars and stripes" in
the back ground.
     What starts as an "interesting"piece of Americana quickly becomes
jingoistic and annoying: Armageddon reifies the old frontier as its
theme.  NASA and the White House have all these scientists and advisors
who are helpless against the end of the world.  They run around like
Chicken-Little wondering how many "nukes" it will take to destroy the
meteor.  In walks the old "working class hero", Willis, who points out
that it takes a "real" man, and not some Pentagon desk jockey, to do
this job.  It is only the same gumption that built America, that can
save it - oh, yes, and the world too I guess.
     We see "foreigners", people of color, wearing "funny" clothes doing
their ethnic things in their far-off and dirty countries praying
superstitiously to their "gods" for salvation - completely unaware that
the good old US of A will save the day.  Even in the States, we see
Norman Rockwell-like tableaus of middle-America, workin' folk gazing
longingly at the Stars and Stripes looking for salvation.  It is
pathetic really - and makes one crave the subtleties of ID4.
     Producer Jerry Bruckheimer, the man who produced The Rock a few
years ago, as the television ads like to constantly point out, fails
Armageddon in the same way he failed with last year's Con-Air; it is not
sufficient to add more explosions, more action, more "zippy one-liners",
if you haven't got a decent script.
     Director Michael Bay (who also directed The Rock), is likewise
positioned to take responsibility for this turkey - he helmed one hit,
and it feels like Bruckheimer automatically assumes that the same
director will rework the same magic.  The problem is that in The Rock,
there was a crackling good script.  The characters were developed, and
the situation was, at least, plausible.  The humor came from the
situation, and did not, like in both Con-Air and Armageddon, get slotted
in as "one-liners".
     At the centre of The Rock was the awkward relationship between Sean
Connery and Nicolas Cage; in Armageddon we have "the awkward
relationship" between Willis' Stamper and Ben Affleck's A. J. Frost, who
is in love with Stamper daughter, Grace, played by Liv Tyler.  With the
Connery - Cage relationship, the two men got to know one another over
the course of the film; but in Armageddon, the relationship between
Willis and Affleck has been on-going for five years - none of which we
see or gets developed in the paint-by-numbers screenplay.  The result is
we don't care: Willis is being a weenie, Affleck is being a "sook". And
Liv Tyler is there just to look beautiful, framed against "Old Glory".
     The cast is alright with what they have to work with.  Chisel-faced
Willis is out to save the world and seems focused on not bursting out
laughing at the absurdity of this movie.  And Affleck is solid enough in
his first real-big movie, after his success in Good Will Hunting.  If
Hollywood needed verification that Affleck is an up-and-coming star,
this movie will probably do that.
     The real waste here is Billy Bob Thornton as NASA supervisor, Dan
Truman; Thornton commands the screen in a way that only a few other
actors can (George Clooney, I think also has this charisma).  Perhaps it
is his Southern drawl, but Thornton can make even the most sentimental
and ridiculous dialogue at least plausible.
     It is worth noting that, as is the standard in Western literature,
the two main protagonists on opposite ends of the central crisis, Willis
in space and Thornton in Houston, are frequently two sides of the same
psyche.  In Armageddon, should you fuse the names of Willis' Harry S.
Stamper with Thornton's Dan Truman, you get Harry S. Truman, the
cold-war president of the Untied States who ordered the bomb dropped on
Japan, another "Armageddon".
     But touches like that, or the brief joke at the beginning of the
movie attacking Godzilla(it's pretty hard to miss), are not sufficient
to save the film.  Neither are the special effects, which range from the
spectacular to the pretty lame.
     In part, I guess one can forgive the bravado of the film's
marketing team: with Dreamworks' Deep Impact beating Armageddon to
theatres by a couple of months, Touchstone needed to save some face.
But unlike last year's Dante's Peak and Volcano, two films which stood
on their own and whose only similarity was the presence of magma, Deep
Impact and Armageddon are virtually the same movie - except that the
former was good.  Sure enough, as I predicted, many people were
disappointed with Deep Impact in that it was character driven with few
scenes of mass destruction (which if you rent out some older movies, you
will discover is more in keeping with the disaster movie genre of the
1970s than the action extravaganzas we see today).  If all you want is
to see stuff blow up and get crushed, then Armageddon may be for you.
     But, as a movie, Armageddon bites.  The script is paint-by-numbers,
the characters are undeveloped, and the racism, sexism, and jingoism
which passes for patriotic heroism in the United States is frankly
offensive.  I cannot believe, or don't want to believe, that even our
cousins from south of the border would like this movie.  But I've been
wrong before.

Rating: *

The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).

The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.

Please direct comments/criticisms of the review to relevant newsgroups.

Broken URLs inthe reviews are the responsibility of the author.

The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.

Related links: index of all rec.arts.movies.reviews reviews


text:
module Rattl::Actions
	class For < Base

		def process
			each_element_reloading do |element|
				trigger_attr_value = element.attributes[trigger_attribute]
				collection_variable_name, single_item = trigger_attr_value.split(':')

				element.remove_attribute(trigger_attribute)
				partial_source = element.to_html

				template_parts = variable_store.get(collection_variable_name).collect do |hash_piece|
					partial_template_variables = variable_store.variable_hash.dup
					partial_template_variables.merge!(single_item.to_sym => hash_piece)

					partial_template = Rattl::Template.new(partial_source)
					partial_template.render(partial_template_variables)
				end
				final_result = template_parts.join("\n")
				element.swap(final_result)
			end
			hdoc
		end

		def clean
			each_element do |element|
				element.remove_attribute(trigger_attribute)
			end
			hdoc
		end

		def each_element
			hdoc.search("//*[@#{trigger_attribute}]").each do |element|
				yield element
			end
		end

		def each_element_reloading
			while element = hdoc.at("//*[@#{trigger_attribute}]")
				yield element
			end
		end

		private

			def trigger_attribute
				'rattl_for'
			end

	end
end

Rattl::ActionStore.register_action(Rattl::Actions::For)


text:
<?xml version="1.0" encoding="UTF-8" ?>
<class name="CSGShape3D" inherits="GeometryInstance3D" version="4.0">
	<brief_description>
		The CSG base class.
	</brief_description>
	<description>
		This is the CSG base class that provides CSG operation support to the various CSG nodes in Godot.
	</description>
	<tutorials>
	</tutorials>
	<methods>
		<method name="get_collision_layer_bit" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="bit" type="int">
			</argument>
			<description>
				Returns an individual bit on the collision mask.
			</description>
		</method>
		<method name="get_collision_mask_bit" qualifiers="const">
			<return type="bool">
			</return>
			<argument index="0" name="bit" type="int">
			</argument>
			<description>
				Returns an individual bit on the collision mask.
			</description>
		</method>
		<method name="get_meshes" qualifiers="const">
			<return type="Array">
			</return>
			<description>
				Returns an [Array] with two elements, the first is the [Transform] of this node and the second is the root [Mesh] of this node. Only works when this node is the root shape.
			</description>
		</method>
		<method name="is_root_shape" qualifiers="const">
			<return type="bool">
			</return>
			<description>
				Returns [code]true[/code] if this is a root shape and is thus the object that is rendered.
			</description>
		</method>
		<method name="set_collision_layer_bit">
			<return type="void">
			</return>
			<argument index="0" name="bit" type="int">
			</argument>
			<argument index="1" name="value" type="bool">
			</argument>
			<description>
				Sets individual bits on the layer mask. Use this if you only need to change one layer's value.
			</description>
		</method>
		<method name="set_collision_mask_bit">
			<return type="void">
			</return>
			<argument index="0" name="bit" type="int">
			</argument>
			<argument index="1" name="value" type="bool">
			</argument>
			<description>
				Sets individual bits on the collision mask. Use this if you only need to change one layer's value.
			</description>
		</method>
	</methods>
	<members>
		<member name="calculate_tangents" type="bool" setter="set_calculate_tangents" getter="is_calculating_tangents" default="true">
			Calculate tangents for the CSG shape which allows the use of normal maps. This is only applied on the root shape, this setting is ignored on any child.
		</member>
		<member name="collision_layer" type="int" setter="set_collision_layer" getter="get_collision_layer" default="1">
			The physics layers this area is in.
			Collidable objects can exist in any of 32 different layers. These layers work like a tagging system, and are not visual. A collidable can use these layers to select with which objects it can collide, using the collision_mask property.
			A contact is detected if object A is in any of the layers that object B scans, or object B is in any layer scanned by object A. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
		</member>
		<member name="collision_mask" type="int" setter="set_collision_mask" getter="get_collision_mask" default="1">
			The physics layers this CSG shape scans for collisions. See [url=https://docs.godotengine.org/en/latest/tutorials/physics/physics_introduction.html#collision-layers-and-masks]Collision layers and masks[/url] in the documentation for more information.
		</member>
		<member name="operation" type="int" setter="set_operation" getter="get_operation" enum="CSGShape3D.Operation" default="0">
			The operation that is performed on this shape. This is ignored for the first CSG child node as the operation is between this node and the previous child of this nodes parent.
		</member>
		<member name="snap" type="float" setter="set_snap" getter="get_snap" default="0.001">
			Snap makes the mesh snap to a given distance so that the faces of two meshes can be perfectly aligned. A lower value results in greater precision but may be harder to adjust.
		</member>
		<member name="use_collision" type="bool" setter="set_use_collision" getter="is_using_collision" default="false">
			Adds a collision shape to the physics engine for our CSG shape. This will always act like a static body. Note that the collision shape is still active even if the CSG shape itself is hidden.
		</member>
	</members>
	<constants>
		<constant name="OPERATION_UNION" value="0" enum="Operation">
			Geometry of both primitives is merged, intersecting geometry is removed.
		</constant>
		<constant name="OPERATION_INTERSECTION" value="1" enum="Operation">
			Only intersecting geometry remains, the rest is removed.
		</constant>
		<constant name="OPERATION_SUBTRACTION" value="2" enum="Operation">
			The second shape is subtracted from the first, leaving a dent with its shape.
		</constant>
	</constants>
</class>


text:
// Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

/**
 * CustomerServiceInterface.java
 *
 * This file was auto-generated from WSDL
 * by the Apache Axis 1.4 Mar 02, 2009 (07:08:06 PST) WSDL2Java emitter.
 */

package com.google.api.ads.adwords.axis.v201809.mcm;

public interface CustomerServiceInterface extends java.rmi.Remote {

    /**
     * Returns details of all the customers directly accessible by
     * the user authenticating the call.
     *

     *         Note: This method will return only test accounts if the developer
     * token used has not been
     *         approved.
     *

     *         Starting with v201607, if {@code clientCustomerId} is specified
     * in the request header,
     *         only details of that customer will be returned. To do this
     * for prior versions, use the
     *         {@code get()} method instead.
     */
    public com.google.api.ads.adwords.axis.v201809.mcm.Customer[] getCustomers() throws java.rmi.RemoteException, com.google.api.ads.adwords.axis.v201809.cm.ApiException;

    /**
     * Retrieves the list of service links for the authorized customer.
     * See {@link ServiceType} for information on the various linking types
     * supported.
     *
     *
     * @param selector describing which links to retrieve
     *
     * @throws ApiException
     */
    public com.google.api.ads.adwords.axis.v201809.mcm.ServiceLink[] getServiceLinks(com.google.api.ads.adwords.axis.v201809.cm.Selector selector) throws java.rmi.RemoteException, com.google.api.ads.adwords.axis.v201809.cm.ApiException;

    /**
     * Update the authorized customer.
     *
     *
While there are a limited set of properties available to
     * update, please read this
     *         help
     * center article
     *         on auto-tagging before updating {@code customer.autoTaggingEnabled}.
     *
     *
     * @param customer the requested updated value for the customer.
     *
     * @throws ApiException
     */
    public com.google.api.ads.adwords.axis.v201809.mcm.Customer mutate(com.google.api.ads.adwords.axis.v201809.mcm.Customer customer) throws java.rmi.RemoteException, com.google.api.ads.adwords.axis.v201809.cm.ApiException;

    /**
     * Modifies links to other services for the authorized customer.
     * See {@link ServiceType} for information on the various linking types
     * supported.
     *
     *
     * @param operations to perform
     *
     * @throws ApiException
     */
    public com.google.api.ads.adwords.axis.v201809.mcm.ServiceLink[] mutateServiceLinks(com.google.api.ads.adwords.axis.v201809.mcm.ServiceLinkOperation[] operations) throws java.rmi.RemoteException, com.google.api.ads.adwords.axis.v201809.cm.ApiException;
}


text:
<!DOCTYPE html>

<!-- Note: this is the Spacelab example template from bootswatch.com -->

<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Trello App</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="Apps for Precision Farm Management.">
    <meta name="author" content="Aaron Ault">

    <!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <link href="../../bootstrap/bootstrap.min.css" rel="stylesheet">
    <link href="../../bootstrap/css/bootstrap-responsive.min.css" rel="stylesheet">
    <link href="../../font-awesome/css/font-awesome.min.css" rel="stylesheet">
    <link href="../../bootswatch/bootswatch.css" rel="stylesheet">

    <style>
      section {
        padding-top: 0px;
      }

      p.lead {
        padding-bottom: 0px;
        margin-bottom: 0px;
      }

      #dropdown-menu-link {
        color: #2D2D2D;
      }
      #dropdown-menu-link:hover {
        color: #F0F0F0;
      }

    </style>
  </head>

  <body class="preview" id="top" data-spy="scroll" data-target=".subnav" data-offset="80">

             <img src="../../images/Screenshot_Trello_sync_rocks_skitch.png"/>

    <!-- Le javascript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
    <script src="bootswatch/jquery.smooth-scroll.min.js"></script>
    <script src="bootstrap/js/bootstrap.min.js"></script>
    <script src="bootswatch/bootswatch.js"></script>

  </body>
</html>


text:
use super::common::ServerArgs;
use crate::{
    common_args::{OutputArgs, OutputFormat},
    metric_collector::ReqwestMetricCollector,
    runner::BlockingRunner,
};
use anyhow::Result;
use clap::Parser;
use std::collections::HashMap;

use super::{
    api::{build_openapi_service, Api},
    configurations_manager::{ConfigurationsManager, NodeConfigurationWrapper},
};

#[derive(Clone, Debug, Parser)]
pub struct GenerateOpenapi {
    #[clap(flatten)]
    server_args: ServerArgs,

    #[clap(flatten)]
    pub output_args: OutputArgs,
}

pub async fn generate_openapi(args: GenerateOpenapi) -> Result<()> {
    let configurations: HashMap<
        _,
        NodeConfigurationWrapper<BlockingRunner<ReqwestMetricCollector>>,
    > = HashMap::new();

    let api: Api<ReqwestMetricCollector, _> = Api {
        configurations_manager: ConfigurationsManager { configurations },
        preconfigured_test_node: None,
        allow_preconfigured_test_node_only: false,
    };

    let api_service = build_openapi_service(api, args.server_args.clone());

    let spec = match args.output_args.format {
        OutputFormat::Json => api_service.spec(),
        OutputFormat::Yaml => api_service.spec_yaml(),
    };
    args.output_args.write(&spec)
}


text:
class ProjectSettingsController < ApplicationController
end


text:
export METASHARETOPDIR=$(readlink -f $(dirname "$0")/..)
export METASHAREDIR=$(dirname "$0")
export SOLR_ROOT=$(cd "$METASHAREDIR/../solr" ; pwd)
export SOLR_LOG=$SOLR_ROOT/solr.log
export SOLR_PORT=8983
export SOLR_STOP_PORT=8079
export SOLR_STOP_KEY=stopkey

export MAINSCHEMAFILE=$SOLR_ROOT/solr/main/conf/schema.xml
export TESTINGSCHEMAFILE=$SOLR_ROOT/solr/testing/conf/schema.xml

# If any solr server is currently running, stop it first:
echo "Checking for a previous running SOLR server..."
"$METASHAREDIR/stop-solr.sh"

sleep 5

# Update schema.xml files, just in case:
source "${METASHAREDIR}/../venv/bin/activate"

python "$METASHARETOPDIR/manage.py" build_solr_schema --filename="$MAINSCHEMAFILE"

deactivate

cp "$MAINSCHEMAFILE" "$TESTINGSCHEMAFILE"

echo "Trying to start SOLR server"

# Actually start solr
(cd "$SOLR_ROOT"
nohup java -Djetty.port=$SOLR_PORT -DSTOP.PORT=$SOLR_STOP_PORT -DSTOP.KEY="$SOLR_STOP_KEY" -jar start.jar > "$SOLR_LOG" 2>&1 &
)


text:
@class MKMethod, MKProperty, MKIVar, MKProtocol;
@import ObjectiveC;

#pragma mark MKMirror
@interface MKMirror : NSObject

/// Reflects an instance of an object or \c Class.
/// @discussion \c MKMirror will immediately gather all useful information. Consider using the
/// \c NSObject categories provided if your code will only use a few pieces of information,
/// or if your code needs to run faster.
///
/// If you reflect an instance of a class then \c methods and \c properties will be populated
/// with instance methods and properties. If you reflect a class itself, then \c methods
/// and \c properties will be populated with class methods and properties as you'd expect.
///
/// @param objectOrClass An instance of an objct or a \c Class object.
/// @return An instance of \c MKMirror.
+ (instancetype)reflect:(id)objectOrClass;

/// The underlying object or \c Class used to create this \c MKMirror instance.
@property (nonatomic, readonly) id   value;
/// Whether the reflected thing was a class or a class instance.
@property (nonatomic, readonly) BOOL isClass;
/// The name of the \c Class of the \c value property.
@property (nonatomic, readonly) NSString *className;

@property (nonatomic, readonly) NSArray<MKProperty*> *properties;
@property (nonatomic, readonly) NSArray<MKIVar*>     *instanceVariables;
@property (nonatomic, readonly) NSArray<MKMethod*>   *methods;
@property (nonatomic, readonly) NSArray<MKProtocol*> *protocols;

/// @return A reflection of \c value.superClass.
@property (nonatomic, readonly) MKMirror *superMirror;

/// @discussion This method is very likely to cause a crash, use at your own risk.
/// Some classes are just not save to touch at all. I did my best to hard code in some unsafe
/// classes to avoid, but Apple might add more at any time.
/// @return An array of all classes known to the runtime.
+ (NSArray *)allClasses;

@end

@interface MKMirror (ExtendedMirror)

/// @return The method with the given name, or \c nil if one does not exist.
- (MKMethod *)methodNamed:(NSString *)name;
/// @return The property with the given name, or \c nil if one does not exist.
- (MKProperty *)propertyNamed:(NSString *)name;
/// @return The instance variable with the given name, or \c nil if one does not exist.
- (MKIVar *)ivarNamed:(NSString *)name;
/// @return The protocol with the given name, or \c nil if one does not exist.
- (MKProtocol *)protocolNamed:(NSString *)name;

@end


text:
class Queue(object):
    """ Implement a queue data structure, ie. FIFO.

    Attrs:
        head: head of the queue.
        tail: tail of the queue.
    """
    def __init__(self):
        self.head = None
        self.tail = None

    def enqueue(self, value):
        node = {'value': value, 'prev': None}

        if self.head == None:
            self.head = self.tail = node
        else:
            self.head['prev'] = node
            self.head = node

    def dequeue(self):
        if self.tail == None:
            return None

        value = self.tail['value']
        self.tail = self.tail['prev']
        if self.tail == None:
            self.head = None
        return value


text:
<?php

namespace yii\gii;

use yii\web\AssetBundle;

/**
 *
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since  2.0
 */
class TypeAheadAsset extends AssetBundle
{
    public $sourcePath = '@bower/typeahead.js/dist';
    public $js = [
        'typeahead.bundle.js',
    ];
    public $depends = [
        'yii\bootstrap\BootstrapAsset',
        'yii\bootstrap\BootstrapPluginAsset',
    ];
}


text:
<?php

class Magehouse_Slider_Block_Ajax extends Mage_Core_Block_Template{
	public function __construct(){

		$this->config = Mage::getStoreConfig('price_slider');
		$this->url = Mage::getStoreConfig('web/unsecure/base_url');

		$this->ajaxSlider = $this->config['ajax_conf']['slider'];
		$this->ajaxLayered = $this->config['ajax_conf']['layered'];
		$this->ajaxToolbar = $this->config['ajax_conf']['toolbar'];
		$this->overlayColor = $this->config['ajax_conf']['overlay_color'];
		$this->overlayOpacity = $this->config['ajax_conf']['overlay_opacity'];
		$this->loadingText = $this->config['ajax_conf']['loading_text'];
		$this->loadingTextColor = $this->config['ajax_conf']['loading_text_color'];
		$this->loadingImage = $this->config['ajax_conf']['loading_image'];
		if($this->loadingImage == '' || $this->loadingImage == null){
			$this->loadingImage = $this->url.'media/magehouse/slider/default/ajax-loader.gif';
		}else{
			$this->loadingImage = $this->url.'media/magehouse/slider/default/'.$loadingImage;
		}
	}

	public function getCallbackJs(){
		return Mage::getStoreConfig('price_slider/ajax_conf/afterAjax');
	}
}


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed><tipo>Rua</tipo><logradouro>Graciola</logradouro><bairro>Esperança</bairro><cidade>Ipatinga</cidade><uf>MG</uf><cep>35162325</cep></feed>


text:
'use strict';

//Menus service used to communicate Menus REST endpoints
angular.module('menus').factory('MenuService', ['$resource',
	function($resource) {
		return $resource('menus/:menuId', { menuId: '@_id'
		}, {
			update: {
				method: 'PUT'
			}
		});
	}
]);


text:
SET(AUTOGEN_TEST_FILES
	src/autogen_test_module/numpy_eigen_test_module.cpp
	src/autogen_test_module/test_int.cpp
	src/autogen_test_module/test_float.cpp
	src/autogen_test_module/test_double.cpp
	src/autogen_test_module/test_uchar.cpp
	src/autogen_test_module/test_long.cpp
)


text:
package ph.url.phlinthetime.mod.asm;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;

import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Label;
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FrameNode;
import org.objectweb.asm.tree.InsnList;
import org.objectweb.asm.tree.InsnNode;
import org.objectweb.asm.tree.LabelNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.VarInsnNode;
import org.objectweb.asm.util.CheckClassAdapter;

import static org.objectweb.asm.Opcodes.*;
import net.minecraft.launchwrapper.IClassTransformer;

public class PHLClassTransformer implements IClassTransformer {

	@Override
	public byte[] transform(String className, String arg1, byte[] bytecode) {// TODO Auto-generated method stub

		if(className.equals("net.minecraft.entity.Entity"))
		return transformEntitySetAngles(className, bytecode, false);

		if(className.equals("sa"))
		return transformEntitySetAngles(className, bytecode, true);

		if(className.equals("net.minecraft.util.MouseHelper"))
		return transFormMouseHelper(className, bytecode, false);

		if(className.equals("bbg"))
		return transFormMouseHelper(className, bytecode, true);

		if(className.equals("net.minecraft.client.model.ModelBiped"))
		return transformSetRotationAngles(className, bytecode, false);

		if(className.equals("bhm"))
		return transformSetRotationAngles(className, bytecode, true);

		if(className.equals("cpw.mods.fml.client.GuiModList"))
		return transformGuiModList(className, bytecode);

		return bytecode;
	}

	private byte[] transformGuiModList(String className, byte[] bytecode) {
		String methodName = "drawScreen";

		ClassNode classNode = new ClassNode();
		ClassReader classReader = new ClassReader(bytecode);
		classReader.accept(classNode, 0);
		Iterator<MethodNode> methods = classNode.methods.iterator();
		while(methods.hasNext()){
			MethodNode m = methods.next();
			if(m.name.equals(methodName)&&m.desc.equals("(IIF)V")){
				System.out.println("Method found");
				Iterator<AbstractInsnNode> insns = m.instructions.iterator();
				while (insns.hasNext()) {
					AbstractInsnNode insn = (AbstractInsnNode) insns.next();

				}

				break;
			}
		}
		ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
		classNode.accept(writer);
		return writer.toByteArray();
	}

	private byte[] transformSetRotationAngles(String className, byte[] bytecode, boolean b) {
		String methodName = "setRotationAngles";
		if(b)methodName = "a";
		System.out.println("Trying to patch: "+className+"."+methodName+"(FFFFFFLnet/minecraft/entity/Entity;)V (Deobf. Name: net.minecraft.client.model.ModelBiped.setRotationAngles(FFFFFFLnet/minecraft/entity/Entity;)V");

		ClassNode classNode = new ClassNode();
		ClassReader classReader = new ClassReader(bytecode);
		classReader.accept(classNode, 0);
		Iterator<MethodNode> methods = classNode.methods.iterator();
		while(methods.hasNext()){
			MethodNode m = methods.next();
			if(m.name.equals(methodName)&&m.desc.equals("(FFFFFFLnet/minecraft/entity/Entity;)V")){
				System.out.println("Method found");
				Iterator<AbstractInsnNode> insns = m.instructions.iterator();
				while (insns.hasNext()) {
					AbstractInsnNode insn = (AbstractInsnNode) insns.next();
					if(insn instanceof FrameNode){
						if(insn.getNext()!=null && insn.getNext().getOpcode() == RETURN){
							InsnList toInject = new InsnList();
							toInject.add(new VarInsnNode(ALOAD, 0));
							toInject.add(new VarInsnNode(FLOAD, 1));
							toInject.add(new VarInsnNode(FLOAD, 2));
							toInject.add(new VarInsnNode(FLOAD, 3));
							toInject.add(new VarInsnNode(FLOAD, 4));
							toInject.add(new VarInsnNode(FLOAD, 5));
							toInject.add(new VarInsnNode(FLOAD, 6));
							toInject.add(new VarInsnNode(ALOAD, 7));
							toInject.add(new MethodInsnNode(INVOKESTATIC, "ph/url/phlinthetime/mod/asm/MethodInvokerClass", "setRotationAngles", "(Lnet/minecraft/client/model/ModelBiped;FFFFFFLnet/minecraft/entity/Entity;)V", false));
							toInject.add(new LabelNode(new Label()));
							m.instructions.insert(insn, toInject);
							System.out.println("found place!!!");
							break;
						}
					}
				}

				break;
			}
		}
		ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
		classNode.accept(writer);
		return writer.toByteArray();
	}

	private byte[] transFormMouseHelper(String className, byte[] bytecode, boolean isObfuscated) {

		String methodName = "mouseXYChange";
		if(isObfuscated)methodName="c";

		//System.out.println("Trying to patch: "+className+"."+methodName+"()V (Deobf. Name: net.minecraft.util.MouseHelper.mouseXYChange()V");

		ClassNode classNode = new ClassNode();
		ClassReader classReader = new ClassReader(bytecode);
		classReader.accept(classNode, 0);
		Iterator<MethodNode> methods = classNode.methods.iterator();
		while(methods.hasNext()){
			MethodNode m = methods.next();
			if(m.name.equals(methodName)&&m.desc.equals("()V")){
				//System.out.println("Method found");
				m.instructions.clear();
				InsnList toInject = new InsnList();
				toInject.add(new VarInsnNode(ALOAD, 0));
				toInject.add(new MethodInsnNode(INVOKESTATIC, "ph/url/phlinthetime/mod/asm/MethodInvokerClass", "mouseXYChange", "(Lnet/minecraft/util/MouseHelper;)V", false));
				toInject.add(new LabelNode(new Label()));
				toInject.add(new InsnNode(RETURN));
				toInject.add(new LabelNode(new Label()));
				m.instructions.insert(toInject);
				//System.out.println("Patching complete!");
				break;
			}
		}

		ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
		classNode.accept(writer);
		return writer.toByteArray();
	}

	public byte[] transformEntitySetAngles(String className, byte[] bytecode, boolean isObfuscated){

		String methodName = "setAngles";
		if(isObfuscated)methodName="c";

		//System.out.println("Trying to patch: "+className+"."+methodName+"(FF)V (Deobf. Name: net.minecraft.entity.Entity.setAngles(FF)V");

		ClassNode classNode = new ClassNode();
		ClassReader classReader = new ClassReader(bytecode);
		classReader.accept(classNode, 0);
		Iterator<MethodNode> methods = classNode.methods.iterator();

		while(methods.hasNext()){
			MethodNode m = methods.next();

			if(m.name.equals(methodName)&&m.desc.equals("(FF)V")){
				m.instructions.clear();
				InsnList toInject = new InsnList();
				toInject.add(new LabelNode(new Label()));
				toInject.add(new VarInsnNode(ALOAD, 0));
				toInject.add(new VarInsnNode(FLOAD, 1));
				toInject.add(new VarInsnNode(FLOAD, 2));
				toInject.add(new MethodInsnNode(INVOKESTATIC, "ph/url/phlinthetime/mod/asm/MethodInvokerClass", "setAngles", "(Lnet/minecraft/entity/Entity;FF)V", false));
				toInject.add(new LabelNode(new Label()));
				toInject.add(new InsnNode(RETURN));
				toInject.add(new LabelNode(new Label()));
				m.instructions.insert(toInject);
				for(int i = 0; i < m.instructions.size(); i++){
				}
				break;
			}
		}
		ClassWriter writer = new ClassWriter(ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES);
		classNode.accept(writer);
		return writer.toByteArray();
	}

}


text:
import Vue from 'vue'
import { fakeServer } from 'sinon'

export default ({ method, url, status, headers, content }) => {
  const server = fakeServer.create()

  server.respondWith(method || 'GET', url, [status || 200, headers, content])

  return () => {
    server.respond()
    server.restore()

    return Vue.nextTick().then(() => server)
  }
}


text:
import setuptools

setuptools.setup(
    name='pyregdict',
    version='0.1',
    description='Access to Windows Registry data as if a Unix file path.',
    author='Charles Aracil',
    author_email='charles.aracil+pyregdict@gmail.com',
    python_requires='>=3.6',
    install_requires=(),
    extras_require={},
    py_modules=['pyregdict', ],
    license=open('LICENSE').read(),
    classifiers=[
        'Development Status :: 4 - Beta',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: MIT',
        'Programming Language :: Python :: 3'
    ],
    long_description=open('README.md').read()
)


text:
@interface OHKeyFrameAnimator : NSObject

- (void)startAnimatingWithDuration:(double)duration progress:(void (^)(double))block;
- (void)startAnimatingWithDuration:(double)duration progress:(void (^)(double))block finish:(void (^)(void))finishBlock;

@end


text:
import os.path

_THIS_LOC = os.path.dirname(__file__)

def load_declaration() -> str:
    with open(os.path.join(_THIS_LOC, 'data', 'declaration.txt'), 'r') as ifp:
        return ifp.read().strip()

WORD_SOURCE_TARGET_PAIRS = [
    # disproportionately long target
    ("how many chucks could a wood chuck",
     "wood chucks are nice animals -- although they will dig holes in your garden. " +
     "how many chucks could a wood chuck if a wood chuck could chuck wood"),
    # disproportionately long source
    (
        "wood chucks are nice animals -- although they will dig holes in your garden. " +
        "how many chucks could a wood chuck if a wood chuck could chuck wood",
        "how many chucks could a wood chuck"),
    # this will not align
    ("this is a test", "sailing up wind is hard"),
    # poor alignment
    ("bad alignments are bad", "on the other hand, good alignments are good"),
    # reasonable alignment
    ("I think this test is fairly reasonable",
     "I stink this test is fairly unreasonable"),
    # reasonable alignment + 1
    ("I think this test is fairly reasonable",
     "I stink this test is fairly unreasonable right???"),
    # poor-ish alignment
    ("no alignment is better than a horrible one?", "i had a horrible headache"),
    ("this is a little bit tricky", "fishes are a very sticky animal"),
    ("this is very crappy and this is a little bit tricky",
     "this is a little bit tricky")
]


text:
<?php

class RequestTest extends \Codeception\TestCase\Test
{

    /**
     * @var \UnitTester
     */
    protected $tester;
    protected $request = null;

    protected function _before()
    {
        $di = new \Phalcon\DI\FactoryDefault();
        $this->request = new \ApiBird\Request($di);
    }

    protected function _after()
    {

    }
    // tests
    public function testContentType()
    {
        $_SERVER['HTTP_CONTENT_TYPE'] = 'text/plain';
        $this->assertEquals('text/plain', $this->request->getContentType());
    }

    public function testEmptyContentType()
    {
        $_SERVER['HTTP_CONTENT_TYPE'] = '*/*';
        $this->assertEquals('', $this->request->getContentType());
    }

    public function testBestAccept()
    {
        $_SERVER['HTTP_ACCEPT'] = 'application/json';
        $this->assertEquals('application/json', $this->request->getBestAccept());
    }

    public function testEmptyBestAccept()
    {
        $_SERVER['HTTP_ACCEPT'] = '*/*';
        $this->assertEquals('', $this->request->getBestAccept());
    }

}


text:
import { batch, batchIn } from './Util';

import lodash from 'lodash';

export default class ChainContext {
    constructor(validators) {
        this.validators = validators || {};
        this.addValidator = (fieldSpec) => {
            this.validators[fieldSpec.field] = fieldSpec;
        }
    }

    set(name, value) {
        const fieldSpec = this.validators[name];
        /* if (fieldSpec && fieldSpec.once && lodash.get(this, name)) {
             throw new Error('Field ' + name + ' is already defined and can only be written once.');
         }*/
        if (value instanceof Function) {
            throw new Error('Function cannot be set as value');
        }
        lodash.set(this, name, () => lodash.clone(value));
    }

    clone() {
        const validators = this.validators || {};
        const copy = new ChainContext(validators);
        lodash.forIn(this, (field, key) => {
            if (key !== 'addValidator' &&
                key !== 'validate' &&
                key !== 'set') {
                if (field instanceof Function) {
                    const value = field();
                    copy.set(key, value);
                }
            }
        });
        return copy;
    }

    cloneFor(context) {
        if (!(context instanceof ChainContext)) {
            throw new Error('Argument must be an instance of ChainContext');
        }
        const validators = this.validators || {};
        const copy = new ChainContext(validators);
        lodash.forIn(this, (field, key) => {
            if (key !== 'addValidator' &&
                key !== 'validate' &&
                key !== 'set' && context.validators && context.validators[key]) {
                if (field instanceof Function) {
                    const value = field();
                    copy.set(key, value);
                }
            } else if (key === '$error' || key === '$owner' || key === '$errorMessage' || key === '$next' || key === '$err') {
                const value = field();
                copy.set(key, value);
            }
        });
        return copy;
    }

    merge(context) {
        const validators = this.validators || {};
        const copy = new ChainContext(validators);
        lodash.forIn(this, (field, key) => {
            if (key !== 'addValidator' &&
                key !== 'validate' &&
                key !== 'set') {
                if (field instanceof Function) {
                    const value = field();
                    copy.set(key, value);
                }
            } else if (key === '$error' || key === '$owner' || key === '$errorMessage' || key === '$next' || key === '$err') {
                const value = field();
                copy.set(key, value);
            }
        });

        lodash.forIn(context, (field, key) => {
            if (key !== 'addValidator' &&
                key !== 'validate' &&
                key !== 'set') {
                if (field instanceof Function) {
                    const value = field();
                    if (!lodash.get(copy, key)) {
                        copy.set(key, value);
                    }
                }
            }
        });
        return copy;
    }
    copy(context) {
        lodash.forIn(context, (field, key) => {
            if (key !== 'addValidator' &&
                key !== 'validate' &&
                key !== 'set') {
                if (field instanceof Function) {
                    const value = field();
                    if (!lodash.get(this, key)) {
                        this.set(key, value);
                    }
                }
            }
        });
    }
    //@deprecated
    validate(param) {
        lodash.forIn(this.validators, validator => validator.validate(param));
    }
    //@deprecated
    transform(context) {
        lodash.forIn(context.validators, (validator, field) => {
            if (validator.transformer) {
                const currentValue = lodash.get(this, field);
                if (currentValue) {
                    validator.transformer(currentValue(), (newValue) => {
                        this.set(field, newValue);
                    });
                }
            }
        });
    }
    //@deprecated
    initDefaults(context) {
        lodash.forIn(context.validators, (validator, field) => {
            if (validator.defaultValue && !lodash.get(this, field)) {
                this.set(field, validator.defaultValue);
            }
        });
    }

    initSpecs(param, done) {
        batchIn(this.validators,
            (validator, next) => {
                if (validator) {
                    batch(validator.getSpecsSequence(), (sequence, nextSequence) => {
                        switch (sequence) {
                            case 'default':
                                validator.initDefault(param);
                                nextSequence();
                                break;
                            case 'require':
                            case 'validator':
                                validator.validate(param, (err) => {
                                    if (err) {
                                        done(err);
                                    } else {
                                        nextSequence();
                                    }
                                });
                                break;
                            case 'transform':
                                validator.initTransformer(param, () => {
                                    nextSequence();
                                });
                                break;
                            case 'translate':
                                validator.initTranslator(param);
                                nextSequence();
                                break;
                        }

                    }, next);
                }
            }, done);
    }
}