text:
// Generated by CoffeeScript 1.7.1
(function() {
  var active, countries, datas, filterList, filters, graph, height, hover, inactive, map, modelEducatif, polygon, popupAtStart, separator, svg, svgHeight, svgWidth, tipSelectOne, tipSelectOther, tipSelectTwo, updateWindow, width;

  svg = d3.select('#leftContent svg');

  polygon = svg.selectAll('polygon');

  filterList = d3.select('#displayData nav');

  height = window.innerHeight;

  width = window.innerWidth;

  svgHeight = svg.attr('height');

  svgWidth = svg.attr('width');

  countries = ['Espagne', 'France', 'Italie', 'Grèce', 'Allemagne', 'Belgique', 'Royaume-Uni', 'Finlande', 'Norvège', 'Luxembourg'];

  tipSelectOne = 'Sélectionnez un des pays en couleur afin de découvrir quel est son modèle éducatif !';

  tipSelectTwo = 'Sélectionnez un deuxième pays afin de comparer ses données au premier !';

  tipSelectOther = 'Cliquez sur un autre pays pour changer votre deuxième sélection ou réinitialisez pour recommencer.';

  separator = ' et ';

  modelEducatif = 'Le modèle éducatif ';

  active = '#f5b355';

  inactive = '#f8f8f8';

  hover = '#06A59B';

  popupAtStart = true;

  updateWindow = function() {
    var temp;
    temp = (svgHeight - height) / 2 + 60;
    return svg.attr('viewBox', '0 ' + temp + ' ' + svgWidth + ' ' + svgHeight);
  };

  window.onresize = function() {
    return updateWindow();
  };

  updateWindow();

  popupAtStart = localStorage.getItem('blurInfos');

  if (popupAtStart === null) {
    d3.select('#blur').classed('closed', false);
  }

  d3.select('#blur button').on('click', function() {
    d3.select('#blur').classed('closed', true);
    return localStorage.setItem('blurInfos', 'bonjour');
  });

  map = {
    init: function() {
      polygon.each(function() {
        d3.select(this).classed('selected', false);
        d3.select(this).classed('second-selection', false);
        return d3.select(this).attr('fill', function() {
          if (countries.indexOf(d3.select(this).attr('data-pays')) > -1) {
            return active;
          } else {
            return inactive;
          }
        });
      });
      d3.selectAll('#infos h2').text('');
      d3.selectAll('#infos span').style('display', 'none');
      return d3.select('#tip').text(tipSelectOne);
    },
    changePointer: function() {
      return polygon.each(function() {
        if (d3.select(this).attr('fill') !== inactive) {
          return d3.select(this).style('cursor', 'pointer');
        }
      });
    },
    onMouseOver: function() {
      var country, el;
      map.changePointer();
      el = d3.select(this);
      country = el.attr('data-pays');

      /*
      		 * Some countries have more than one polygon. So we have to find all polygons with the same data-pays
      		 * Conditions needed :
      		 * * Country clickable
      		 * * Data-pays is like country we are on hover (or the country has selected class)
       */
      return polygon.each(function() {
        if (el.attr('fill') !== inactive && d3.select(this).attr('data-pays') === country || d3.select(this).classed('selected') === true) {
          return d3.select(this).attr('fill', hover);
        }
      });
    },
    onMouseLeave: function() {
      return polygon.each(function() {
        if (d3.select(this).attr('fill') !== inactive && d3.select(this).classed('selected') === false) {
          return d3.select(this).attr('fill', active);
        }
      });
    },
    onClick: function() {
      var counter, country, counts, el, i, tempArray, textCountry, _i, _len;
      el = d3.select(this);
      country = el.attr('data-pays');
      counter = 0;
      tempArray = [];
      counts = [];
      polygon.each(function() {
        if (d3.select(this).classed('selected') === true) {
          return tempArray.push(d3.select(this).attr('data-pays'));
        }
      });
      for (_i = 0, _len = tempArray.length; _i < _len; _i++) {
        i = tempArray[_i];
        if (counts.indexOf(i) === -1) {
          counts.push(i);
        }
      }
      counter = counts.length;
      if (el.attr('fill') === hover && el.classed('selected') === false) {
        switch (counter) {
          case 0:
            polygon.each(function() {
              if (d3.select(this).attr('data-pays') === el.attr('data-pays')) {
                return d3.select(this).classed('selected', true).attr('fill', hover);
              }
            });
            d3.select('.country').text(country);
            d3.select('#tip').text(tipSelectTwo);
            break;
          case 1:
            polygon.each(function() {
              if (d3.select(this).attr('data-pays') === el.attr('data-pays')) {
                return d3.select(this).classed('selected second-selection', true).attr('fill', hover);
              }
            });
            textCountry = d3.select('.country').text();
            d3.select('.country').text(textCountry + separator + el.attr('data-pays'));
            d3.select('.reset-map').style('display', 'inline-block');
            d3.select('#tip').text(tipSelectOther);
            break;
          case 2:
            polygon.each(function() {
              if (d3.select(this).classed('second-selection') === true) {
                d3.select(this).classed('selected second-selection', false);
                return d3.select(this).attr('fill', active);
              }
            });
            polygon.each(function() {
              if (d3.select(this).attr('data-pays') === el.attr('data-pays')) {
                return d3.select(this).classed('selected second-selection', true).attr('fill', hover);
              }
            });
            textCountry = d3.select('.country').text();
            textCountry = textCountry.split(' ');
            d3.select('.country').text(textCountry[0] + separator + el.attr('data-pays'));
        }
        return d3.select('.more-info').style('display', 'inline-block').attr('data-pays', country);
      }
    }
  };

  graph = {
    init: function(filter) {
      d3.json('data/filters.json', function(root) {
        if (filter === 'noFilter') {
          return d3.select('#graph-description').html('');
        } else {
          return d3.select('#graph-description').html(root[filter].html);
        }
      });
      d3.selectAll('#datas > div').classed('active', false);
      d3.select('#' + filter).classed('active', true);
      return graph.createGraph(filter);
    },
    createGraph: function(filter) {
      var country, cycles, el, matieres, ratios, salaires, scores;
      el = d3.select('#' + filter);
      country = d3.select('#displayData').attr('data-pays');
      switch (filter) {
        case 'coutEtudiant':
          cycles = ['primaire', 'college', 'lycee'];
          return d3.json('data/countries/' + country + '.json', function(data) {
            var key, numbers, _i, _len, _results;
            numbers = data[filter];
            _results = [];
            for (_i = 0, _len = cycles.length; _i < _len; _i++) {
              key = cycles[_i];
              _results.push(d3.select('#coutEtudiant .' + key + ' span').text(numbers[key]['cout']));
            }
            return _results;
          });
        case 'encadrement':
          cycles = ['primaire', 'college', 'lycee'];
          return d3.json('data/countries/' + country + '.json', function(data) {
            var key, _i, _len, _results;
            data = data[filter];
            _results = [];
            for (_i = 0, _len = cycles.length; _i < _len; _i++) {
              key = cycles[_i];
              d3.select('#encadrement .' + key + ' .elevesParClass .value').text(data[key]['elevesParClass']);
              _results.push(d3.select('#encadrement .' + key + ' .elevesParEnseignant .value').text(data[key]['elevesParEnseignant']));
            }
            return _results;
          });
        case 'rythme':
          d3.selectAll('#rythme .graph-bar .totalStudy').style('width', '0%');
          d3.selectAll('#rythme .graph-bar .totalVacs').style('width', '0%');
          cycles = ['primaire', 'college', 'lycee'];
          return d3.json('data/countries/' + country + '.json', function(data) {
            var key, percentageVacs, percentageWork, _i, _len, _results;
            data = data[filter];
            _results = [];
            for (_i = 0, _len = cycles.length; _i < _len; _i++) {
              key = cycles[_i];
              percentageWork = (data[key]['daysByYear'] / data[key]['daysByWeek']) * 100 / 52;
              percentageVacs = data[key]['totalVacs'] * 100 / 52;
              d3.select('#rythme .' + key + ' .graph-bar .totalStudy').transition().duration(1500).style('width', (percentageWork - 2) + '%');
              d3.select('#rythme .' + key + ' .graph-bar .totalVacs').transition().duration(1500).style('width', (percentageVacs - 2) + '%');
              d3.select('#rythme .' + key + ' .graph-data .totalStudy').attr('style', 'width:' + (percentageWork - 2) + '%');
              d3.select('#rythme .' + key + ' .graph-data .totalVacs').attr('style', 'width:' + (percentageVacs - 2) + '%');
              d3.select('#rythme .' + key + ' .graph-data .totalStudy > span:first-child span').text(data[key]['daysByYear']);
              d3.select('#rythme .' + key + ' .graph-data .totalStudy > span:last-child span').text(data[key]['daysByWeek']);
              d3.select('#rythme .' + key + ' .graph-data .totalVacs > span:first-child span').text(data[key]['summerVacs']);
              _results.push(d3.select('#rythme .' + key + ' .graph-data .totalVacs > span:last-child span').text(data[key]['totalVacs']));
            }
            return _results;
          });
        case 'salaire':
          d3.selectAll('#salaire .graph-start').style('width', '0%');
          d3.selectAll('#salaire .graph-end').style('width', '0%');
          salaires = [];
          cycles = ['primaire', 'college', 'lycee'];
          return d3.json('data/countries/' + country + '.json', function(data) {
            var key, percentage, salaireEnd, salaireStart, _i, _len, _results;
            salaires = data[filter];
            _results = [];
            for (_i = 0, _len = cycles.length; _i < _len; _i++) {
              key = cycles[_i];
              salaireStart = salaires[key]['start'];
              salaireEnd = salaires[key]['end'];
              d3.select('#salaire .' + key + ' .start').text(salaireStart);
              d3.select('#salaire .' + key + ' .preetyName').text(salaires[key]['preetyName']);
              d3.select('#salaire .' + key + ' .end').text(salaireEnd);
              percentage = salaireStart * 100 / salaireEnd;
              d3.select('#salaire .' + key + ' .graph-start').transition().duration(1500).style('width', percentage + '%');
              _results.push(d3.select('#salaire .' + key + ' .graph-end').transition().duration(1500).style('width', '100%'));
            }
            return _results;
          });
        case 'cycle':
          d3.select('#cycle .graph-bar').style('width', '0%');
          cycles = ['primaire', 'college', 'lycee'];
          return d3.json('data/countries/' + country + '.json', function(data) {
            var heuresParAn, key, nombreAnneesCycles, nombreAnneesOblig, nombreTotalAnnees, percentageCycleWidth, percentageWidth, sum, _i, _j, _len, _len1, _results;
            data = data[filter];
            nombreTotalAnnees = [];
            for (_i = 0, _len = cycles.length; _i < _len; _i++) {
              key = cycles[_i];
              nombreTotalAnnees.push(data[key]['number']);
            }
            sum = nombreTotalAnnees.reduce(function(pv, cv) {
              return pv + cv;
            });
            _results = [];
            for (_j = 0, _len1 = cycles.length; _j < _len1; _j++) {
              key = cycles[_j];
              nombreAnneesCycles = data[key]['number'];
              nombreAnneesOblig = data[key]['numberOblig'];
              heuresParAn = data[key]['hours'];
              d3.select('#cycle .graph-bar').transition().duration(2000).style('width', '100%');
              percentageWidth = nombreAnneesCycles * 100 / sum;
              d3.selectAll('#cycle .' + key).attr('style', 'width:' + (percentageWidth - 1) + '%');
              percentageCycleWidth = nombreAnneesOblig * 100 / nombreAnneesCycles;
              d3.selectAll('#cycle .' + key + ' .nombreAnneesOblig').attr('style', 'width:' + percentageCycleWidth + '%');
              d3.selectAll('#cycle .' + key + ' .nombreAnneesNonOblig').attr('style', 'margin-left:' + percentageCycleWidth + '%');
              d3.select('#cycle .numbers .' + key + ' .nombreAnneesOblig').transition().text(nombreAnneesOblig);
              if (nombreAnneesCycles - nombreAnneesOblig !== 0) {
                d3.select('#cycle .numbers .' + key + ' .nombreAnneesNonOblig').text(nombreAnneesCycles - nombreAnneesOblig);
              }
              _results.push(d3.select('#cycle .cycle .' + key + ' span:last-child').text(heuresParAn + 'h par an'));
            }
            return _results;
          });
        case 'test':
          scores = [];
          matieres = ['maths', 'ecrit', 'science'];
          d3.selectAll('#test .graph-bar').style('height', '0%');
          return d3.json('data/countries/' + country + '.json', function(data) {
            var key, percentage, score, _i, _len, _results;
            scores = data[filter];
            _results = [];
            for (_i = 0, _len = matieres.length; _i < _len; _i++) {
              key = matieres[_i];
              score = scores[key]['score'];
              d3.select('#test .' + key + ' .preetyName').text(scores[key]['preetyName']);
              d3.select('#test .' + key + ' .score').text(score);
              percentage = score * 100 / 1000;
              _results.push(d3.select('#test .' + key + ' .graph-bar').transition().duration(1000).style('height', percentage + '%'));
            }
            return _results;
          });
        case 'ratioHF':
          d3.selectAll('#ratioHF div').remove();
          ratios = [];
          cycles = ['primaire', 'college', 'lycee'];
          return d3.json('data/countries/' + country + '.json', function(data) {
            var arc, arcs, key, man, pie, radius, ratio, vis, women, _i, _len, _results;
            ratios = data[filter];
            _results = [];
            for (_i = 0, _len = cycles.length; _i < _len; _i++) {
              key = cycles[_i];
              man = ratios[key]['man'];
              women = ratios[key]['women'];
              ratio = [
                {
                  "label": "Homme",
                  "value": man,
                  "color": "#f6c37a",
                  "textColor": '#834d00'
                }, {
                  "label": "Femme",
                  "value": women,
                  "color": "#45b4a4",
                  "textColor": '#005046'
                }
              ];
              width = 150;
              height = 150;
              radius = 75;
              vis = d3.select('#ratioHF').append('div').classed(key, true).append('svg:svg').data([ratio]).attr('width', width).attr('height', height).append('svg:g').attr('transform', 'translate(' + radius + ',' + radius + ')');
              d3.select('#ratioHF > div:last-child').append('span').classed('preetyName', true).text(function(d, i) {
                return ratios[key].preetyName;
              });
              arc = d3.svg.arc().outerRadius(radius);
              pie = d3.layout.pie().value(function(d) {
                return d.value;
              });
              arcs = vis.selectAll('g.slice').data(pie).enter().append('svg:g').attr('class', 'slice');
              arcs.append('svg:path').attr('fill', function(d, i) {
                return ratio[i].color;
              }).attr('d', arc);
              _results.push(arcs.append('svg:text').attr('transform', function(d) {
                d.innerRadius = 0;
                d.outerRadius = radius;
                return "translate(" + arc.centroid(d) + ")";
              }).attr('text-anchor', "middle").attr('fill', function(d, i) {
                return ratio[i].textColor;
              }).attr('style', 'font-size:.7em').text(function(d, i) {
                return ratio[i].value + '%';
              }));
            }
            return _results;
          });
        case 'sport':
          d3.selectAll('#sport div').remove();
          ratios = [];
          cycles = ['primaire', 'college', 'lycee'];
          return d3.json('data/countries/' + country + '.json', function(data) {
            var arc, arcs, key, minHoursByYear, minPercentage, pie, radius, ratio, vis, _i, _len, _results;
            ratios = data[filter];
            _results = [];
            for (_i = 0, _len = cycles.length; _i < _len; _i++) {
              key = cycles[_i];
              minPercentage = ratios[key]['minPercentage'];
              minHoursByYear = ratios[key]['minHoursByYear'];
              ratio = [
                {
                  "label": "",
                  "value": minPercentage,
                  "color": "#f6c37a",
                  "textColor": '#834d00'
                }, {
                  "label": "",
                  "value": 100 - minPercentage,
                  "color": "#45b4a4",
                  "textColor": '#005046'
                }
              ];
              width = 150;
              height = 150;
              radius = 75;
              vis = d3.select('#sport').append('div').classed(key, true).append('svg:svg').data([ratio]).attr('width', width).attr('height', height).append('svg:g').attr('transform', 'translate(' + radius + ',' + radius + ')');
              d3.select('#sport > div:last-child').append('span').classed('info', true).text(function(d, i) {
                return '(Soit ' + ratios[key].minHoursByYear + ' heures par an)';
              });
              d3.select('#sport > div:last-child').append('span').classed('preetyName', true).text(function(d, i) {
                return ratios[key].preetyName;
              });
              arc = d3.svg.arc().outerRadius(radius);
              pie = d3.layout.pie().value(function(d) {
                return d.value;
              });
              arcs = vis.selectAll('g.slice').data(pie).enter().append('svg:g').attr('class', 'slice');
              arcs.append('svg:path').attr('fill', function(d, i) {
                return ratio[i].color;
              }).attr('d', arc);
              _results.push(arcs.append('svg:text').attr('transform', function(d) {
                d.innerRadius = 0;
                d.outerRadius = radius;
                return "translate(" + arc.centroid(d) + ")";
              }).attr('text-anchor', "middle").attr('fill', function(d, i) {
                return ratio[i].textColor;
              }).attr('style', 'font-size:.7em').text(function(d, i) {
                return ratio[i].value + '%';
              }));
            }
            return _results;
          });
      }
    }
  };

  filters = {
    onMouseOver: function() {
      var info;
      info = d3.select(this).attr('data-filter');
      return d3.json('data/filters.json', function(root) {
        return d3.select('#active-filter').text(root[info].short);
      });
    },
    onMouseLeave: function() {
      return filterList.selectAll('div').each(function() {
        var info;
        if (d3.select(this).classed('active') === true) {
          info = d3.select(this).attr('data-filter');
          return d3.json('data/filters.json', function(root) {
            return d3.select('#active-filter').text(root[info].short);
          });
        }
      });
    },
    onClick: function() {
      var el, info;
      el = d3.select(this);
      info = d3.select(this).attr('data-filter');
      filterList.selectAll('div').classed('active', false);
      el.classed('active', true);
      d3.json('data/filters.json', function(root) {
        return d3.select('#active-filter').text(root[info].short);
      });
      return graph.init(info);
    }
  };

  datas = {
    init: function() {
      var el;
      d3.select('#leftContent').classed('extended', true);
      d3.select('#displayData').classed('dataPanelOpened', true);
      d3.select('#filters').classed('closed', true);
      map.init();
      el = d3.select(this);
      d3.select('#displayData').attr('data-pays', el.attr('data-pays'));
      return d3.json('data/countries/' + el.attr('data-pays') + '.json', function(root) {
        return d3.select('#datas h2').text(modelEducatif + root.preposition + el.attr('data-pays'));
      });
    },
    close: function() {
      d3.select('#leftContent').classed('extended', false);
      d3.select('#displayData').classed('dataPanelOpened', false);
      return d3.select('#filters').classed('closed', false);
    }
  };

  d3.select('.reset-map').on('click', map.init);

  polygon.on('mouseover', map.onMouseOver).on('mouseleave', map.onMouseLeave).on('click', map.onClick).each(function(d) {
    return d3.select(this).attr('fill', function() {
      if (countries.indexOf(d3.select(this).attr('data-pays')) > -1) {
        return active;
      } else {
        return inactive;
      }
    });
  });

  filterList.on('mouseleave', filters.onMouseLeave).selectAll('div').on('mouseover', filters.onMouseOver).on('click', filters.onClick);

  d3.select('.more-info').on('click', datas.init);

  d3.select('#closeDataView').on('click', datas.close);

}).call(this);


text:
title: Who Am I?
layout: default
---
Hi!
--------
I'm Hugo, known as `drummersbrother`, `ilykxar` or `hb11002` on the internet.
I love coding (mostly in python), and the project I'm most proud of is [anna-bot](https://github.com/drummersbrother/anna-bot)

I also don't know much about jekyll or how github pages works, so I guess this will be fun and educational.

redpajama_set_name: RedPajamaGithub


text:
The **friendly owner** parts of a Living Lots site are where the people who
live in neighborhoods can suggest land that does not already exist in our data
is vacant and should be added to our data.

Unlike [groundtruthing](groundtruth) which involves people correcting existing
data (ie by saying "this isn't actually vacant"), **friendly owners** are
inherently places that are **not** already in our data—it's how we find out
about new places people can organize around!

The name "friendly owner" comes from the original use of this functionality.
When it was first written, the only use case was owners of land suggesting that
we add their land to our data to give communities a way to find out about it.

## What is a friendly owner?

A friendly owner contains the contact information for the person who suggested
the land be added to our data (name, email, phone number, etc) and, importantly,
the **parcel** that the person is suggesting.

## How is a friendly owner added?

A friendly owner is added when someone fills out a friendly owner form.
Depending on how Living Lots is configured, this for may not be enabled or will
be accessed in a variety of ways. For example, in Grounded in Philly there is a
link under the search bar:

![Friendly owner button](img/friendly-owner-link.png)

Once the link is clicked, all parcels will be overlaid on the map. The person
adding the entry selects a parcel, enters their contact information, and submits
their suggestion.

![Friendly owner parcel selection](img/friendly-owner-parcel-selected.png)

## What happens when a friendly owner is added?

The site will automatically send the facilitator an email. Nothing else happens
until the facilitator approves it. This way someone can't suggest that the
entire city is actually one large vacant lot!

Once the facilitator approves the friendly owner, the lot will be added to the
map.


text:
// Copyright 2015-2016 Espressif Systems (Shanghai) PTE LTD
//
// 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.

/**
 * common/bt_defs.h    Defines useful API for whole Bluedroid
 *
 */
#ifndef _BT_DEFS_H_
#define _BT_DEFS_H_

#include <stdlib.h>
#include <stdint.h>
#include "common/bt_trace.h"
#include "common/bt_target.h"

#define UNUSED(x)                   (void)(x)

/*Timer Related Defination*/

//by Snake.T
typedef void (TIMER_CBACK)(void *p_tle);
typedef struct _tle {
    struct _tle  *p_next;
    struct _tle  *p_prev;
    TIMER_CBACK  *p_cback;
    INT32         ticks;
    INT32         ticks_initial;
    TIMER_PARAM_TYPE   param;
    TIMER_PARAM_TYPE   data;
    UINT16        event;
    UINT8         in_use;
} TIMER_LIST_ENT;

#define alarm_timer_t               uint32_t
#define alarm_timer_setfn(timer, cb, data)           \
do {                                                 \
} while (0)
#define alarm_timer_arm(timer, to, periodic)         \
do {                                                 \
} while (0)
#define alarm_timer_disarm(timer)                    \
do {                                                 \
} while (0)
#define alarm_timer_now()             (0)

/*Bluetooth Address*/
typedef struct {
    uint8_t address[6];
} __attribute__ ((__packed__)) bt_bdaddr_t;

/** Bluetooth 128-bit UUID */
typedef struct {
    uint8_t uu[16];
} bt_uuid_t;

/** Bluetooth Error Status */
/** We need to build on this */

/* relate to ESP_BT_STATUS_xxx in esp_bt_defs.h */
typedef enum {
    BT_STATUS_SUCCESS = 0,
    BT_STATUS_FAIL,
    BT_STATUS_NOT_READY,
    BT_STATUS_NOMEM,
    BT_STATUS_BUSY,
    BT_STATUS_DONE,        /* request already completed */
    BT_STATUS_UNSUPPORTED,
    BT_STATUS_PARM_INVALID,
    BT_STATUS_UNHANDLED,
    BT_STATUS_AUTH_FAILURE,
    BT_STATUS_RMT_DEV_DOWN,
    BT_STATUS_AUTH_REJECTED,
    BT_STATUS_INVALID_STATIC_RAND_ADDR,
    BT_STATUS_PENDING,
    BT_STATUS_UNACCEPT_CONN_INTERVAL,
    BT_STATUS_PARAM_OUT_OF_RANGE,
    BT_STATUS_TIMEOUT,
    BT_STATUS_MEMORY_FULL,
} bt_status_t;

#ifndef CPU_LITTLE_ENDIAN
#define CPU_LITTLE_ENDIAN
#endif

inline uint16_t swap_byte_16(uint16_t x)
{
    return (((x & 0x00ffU) << 8) |
            ((x & 0xff00U) >> 8));
}

inline uint32_t swap_byte_32(uint32_t x)
{
    return (((x & 0x000000ffUL) << 24) |
            ((x & 0x0000ff00UL) << 8) |
            ((x & 0x00ff0000UL) >> 8) |
            ((x & 0xff000000UL) >> 24));
}

#ifndef ntohs
inline uint16_t ntohs(uint16_t x)
{
#ifdef CPU_LITTLE_ENDIAN
    return swap_byte_16(x);
#else
    return x;
#endif
}
#endif /* #ifndef ntohs */

#ifndef htons
inline uint16_t htons(uint16_t x)
{
#ifdef CPU_LITTLE_ENDIAN
    return swap_byte_16(x);
#else
    return x;
#endif
}
#endif /* #ifndef htons */

#ifndef ntohl
inline uint32_t ntohl(uint32_t x)
{
#ifdef CPU_LITTLE_ENDIAN
    return swap_byte_32(x);
#else
    return x;
#endif
}
#endif /* #ifndef ntohl*/

#ifndef htonl
inline uint32_t htonl(uint32_t x)
{
#ifdef CPU_LITTLE_ENDIAN
    return swap_byte_32(x);
#else
    return x;
#endif
}
#endif /* #ifndef htonl*/

#endif /* _BT_DEFS_H_ */


text:
using System;
using umbraco.interfaces;
using umbraco.BasePages;
using Umbraco.Core;

namespace umbraco.BusinessLogic.Actions
{
	/// <summary>
	/// This action is invoked when the trash can is emptied
	/// </summary>
	public class ActionEmptyTranscan : IAction
	{
		//create singleton
		private static readonly ActionEmptyTranscan InnerInstance = new ActionEmptyTranscan();

		/// <summary>
		/// A public constructor exists ONLY for backwards compatibility in regards to 3rd party add-ons.
		/// All Umbraco assemblies should use the singleton instantiation (this.Instance)
		/// When this applicatio is refactored, this constuctor should be made private.
		/// </summary>
		[Obsolete("Use the singleton instantiation instead of a constructor")]
		public ActionEmptyTranscan() { }

		public static ActionEmptyTranscan Instance
		{
			get { return InnerInstance; }
		}

		#region IAction Members

		public char Letter
		{
			get
			{
				return 'N';
			}
		}

		public string JsFunctionName
		{
			get
			{
				return string.Format("{0}.actionEmptyTranscan()", ClientTools.Scripts.GetAppActions);
			}
		}

		public string JsSource
		{
			get
			{
				return null;
			}
		}

		public string Alias
		{
			get
			{
				return "emptyRecycleBin";
			}
		}

		public string Icon
		{
			get
			{
				return "trash";
			}
		}

		public bool ShowInNotifier
		{
			get
			{
				return false;
			}
		}
		public bool CanBePermissionAssigned
		{
			get
			{
				return false;
			}
		}

        #endregion

    }
}


text:
from ezdxf.addons.xqt import QtCore, QtGui, QtWidgets

class Ui_FindDialog(object):
    def setupUi(self, FindDialog):
        FindDialog.setObjectName("FindDialog")
        FindDialog.resize(320, 376)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(FindDialog.sizePolicy().hasHeightForWidth())
        FindDialog.setSizePolicy(sizePolicy)
        FindDialog.setMinimumSize(QtCore.QSize(320, 376))
        FindDialog.setMaximumSize(QtCore.QSize(320, 376))
        FindDialog.setBaseSize(QtCore.QSize(320, 376))
        self.verticalLayout_5 = QtWidgets.QVBoxLayout(FindDialog)
        self.verticalLayout_5.setObjectName("verticalLayout_5")
        self.verticalLayout = QtWidgets.QVBoxLayout()
        self.verticalLayout.setObjectName("verticalLayout")
        self.horizontalLayout = QtWidgets.QHBoxLayout()
        self.horizontalLayout.setSizeConstraint(QtWidgets.QLayout.SetFixedSize)
        self.horizontalLayout.setObjectName("horizontalLayout")
        self.label = QtWidgets.QLabel(FindDialog)
        self.label.setObjectName("label")
        self.horizontalLayout.addWidget(self.label)
        self.find_text_edit = QtWidgets.QLineEdit(FindDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.find_text_edit.sizePolicy().hasHeightForWidth())
        self.find_text_edit.setSizePolicy(sizePolicy)
        self.find_text_edit.setMinimumSize(QtCore.QSize(0, 24))
        self.find_text_edit.setMaximumSize(QtCore.QSize(16777215, 24))
        self.find_text_edit.setObjectName("find_text_edit")
        self.horizontalLayout.addWidget(self.find_text_edit)
        self.verticalLayout.addLayout(self.horizontalLayout)
        self.groupBox = QtWidgets.QGroupBox(FindDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.MinimumExpanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox.sizePolicy().hasHeightForWidth())
        self.groupBox.setSizePolicy(sizePolicy)
        self.groupBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.groupBox.setFlat(False)
        self.groupBox.setObjectName("groupBox")
        self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.groupBox)
        self.verticalLayout_3.setObjectName("verticalLayout_3")
        self.whole_words_check_box = QtWidgets.QCheckBox(self.groupBox)
        self.whole_words_check_box.setObjectName("whole_words_check_box")
        self.verticalLayout_3.addWidget(self.whole_words_check_box)
        self.match_case_check_box = QtWidgets.QCheckBox(self.groupBox)
        self.match_case_check_box.setObjectName("match_case_check_box")
        self.verticalLayout_3.addWidget(self.match_case_check_box)
        self.number_tags_check_box = QtWidgets.QCheckBox(self.groupBox)
        self.number_tags_check_box.setObjectName("number_tags_check_box")
        self.verticalLayout_3.addWidget(self.number_tags_check_box)
        self.verticalLayout.addWidget(self.groupBox, 0, QtCore.Qt.AlignTop)
        self.groupBox_2 = QtWidgets.QGroupBox(FindDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.groupBox_2.sizePolicy().hasHeightForWidth())
        self.groupBox_2.setSizePolicy(sizePolicy)
        self.groupBox_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignTop)
        self.groupBox_2.setObjectName("groupBox_2")
        self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupBox_2)
        self.verticalLayout_4.setObjectName("verticalLayout_4")
        self.header_check_box = QtWidgets.QCheckBox(self.groupBox_2)
        self.header_check_box.setChecked(True)
        self.header_check_box.setObjectName("header_check_box")
        self.verticalLayout_4.addWidget(self.header_check_box)
        self.classes_check_box = QtWidgets.QCheckBox(self.groupBox_2)
        self.classes_check_box.setObjectName("classes_check_box")
        self.verticalLayout_4.addWidget(self.classes_check_box)
        self.tables_check_box = QtWidgets.QCheckBox(self.groupBox_2)
        self.tables_check_box.setChecked(True)
        self.tables_check_box.setObjectName("tables_check_box")
        self.verticalLayout_4.addWidget(self.tables_check_box)
        self.blocks_check_box = QtWidgets.QCheckBox(self.groupBox_2)
        self.blocks_check_box.setChecked(True)
        self.blocks_check_box.setObjectName("blocks_check_box")
        self.verticalLayout_4.addWidget(self.blocks_check_box)
        self.entities_check_box = QtWidgets.QCheckBox(self.groupBox_2)
        self.entities_check_box.setChecked(True)
        self.entities_check_box.setObjectName("entities_check_box")
        self.verticalLayout_4.addWidget(self.entities_check_box)
        self.objects_check_box = QtWidgets.QCheckBox(self.groupBox_2)
        self.objects_check_box.setChecked(False)
        self.objects_check_box.setObjectName("objects_check_box")
        self.verticalLayout_4.addWidget(self.objects_check_box)
        self.verticalLayout.addWidget(self.groupBox_2, 0, QtCore.Qt.AlignTop)
        self.verticalLayout_5.addLayout(self.verticalLayout)
        self.message = QtWidgets.QLabel(FindDialog)
        self.message.setObjectName("message")
        self.verticalLayout_5.addWidget(self.message)
        self.buttons_layout = QtWidgets.QHBoxLayout()
        self.buttons_layout.setSizeConstraint(QtWidgets.QLayout.SetNoConstraint)
        self.buttons_layout.setObjectName("buttons_layout")
        self.find_forward_button = QtWidgets.QPushButton(FindDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.find_forward_button.sizePolicy().hasHeightForWidth())
        self.find_forward_button.setSizePolicy(sizePolicy)
        self.find_forward_button.setMinimumSize(QtCore.QSize(0, 0))
        self.find_forward_button.setMaximumSize(QtCore.QSize(200, 100))
        self.find_forward_button.setObjectName("find_forward_button")
        self.buttons_layout.addWidget(self.find_forward_button, 0, QtCore.Qt.AlignBottom)
        self.find_backwards_button = QtWidgets.QPushButton(FindDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.find_backwards_button.sizePolicy().hasHeightForWidth())
        self.find_backwards_button.setSizePolicy(sizePolicy)
        self.find_backwards_button.setMinimumSize(QtCore.QSize(0, 0))
        self.find_backwards_button.setMaximumSize(QtCore.QSize(200, 100))
        self.find_backwards_button.setObjectName("find_backwards_button")
        self.buttons_layout.addWidget(self.find_backwards_button, 0, QtCore.Qt.AlignBottom)
        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
        self.buttons_layout.addItem(spacerItem)
        self.close_button = QtWidgets.QPushButton(FindDialog)
        sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.close_button.sizePolicy().hasHeightForWidth())
        self.close_button.setSizePolicy(sizePolicy)
        self.close_button.setMinimumSize(QtCore.QSize(0, 0))
        self.close_button.setMaximumSize(QtCore.QSize(200, 100))
        self.close_button.setToolTip("")
        self.close_button.setObjectName("close_button")
        self.buttons_layout.addWidget(self.close_button, 0, QtCore.Qt.AlignRight|QtCore.Qt.AlignBottom)
        self.verticalLayout_5.addLayout(self.buttons_layout)

        self.retranslateUi(FindDialog)
        QtCore.QMetaObject.connectSlotsByName(FindDialog)

    def retranslateUi(self, FindDialog):
        _translate = QtCore.QCoreApplication.translate
        FindDialog.setWindowTitle(_translate("FindDialog", "Find"))
        self.label.setText(_translate("FindDialog", "Find Text:"))
        self.groupBox.setTitle(_translate("FindDialog", "Options"))
        self.whole_words_check_box.setToolTip(_translate("FindDialog", "Search only whole words in normal mode if checked."))
        self.whole_words_check_box.setText(_translate("FindDialog", "Whole Words"))
        self.match_case_check_box.setToolTip(_translate("FindDialog", "Case sensitive search in normal mode if checked."))
        self.match_case_check_box.setText(_translate("FindDialog", "Match Case"))
        self.number_tags_check_box.setToolTip(_translate("FindDialog", "Ignore numeric DXF tags if checked."))
        self.number_tags_check_box.setText(_translate("FindDialog", "Search in Numeric Tags"))
        self.groupBox_2.setToolTip(_translate("FindDialog", "Select sections to search in."))
        self.groupBox_2.setTitle(_translate("FindDialog", "Search in Sections"))
        self.header_check_box.setText(_translate("FindDialog", "HEADER"))
        self.classes_check_box.setText(_translate("FindDialog", "CLASSES"))
        self.tables_check_box.setText(_translate("FindDialog", "TABLES"))
        self.blocks_check_box.setText(_translate("FindDialog", "BLOCKS"))
        self.entities_check_box.setText(_translate("FindDialog", "ENTITIES"))
        self.objects_check_box.setText(_translate("FindDialog", "OBJECTS"))
        self.message.setText(_translate("FindDialog", "TextLabel"))
        self.find_forward_button.setToolTip(_translate("FindDialog", "or press F3"))
        self.find_forward_button.setText(_translate("FindDialog", "Find &Forward"))
        self.find_backwards_button.setToolTip(_translate("FindDialog", "or press F4"))
        self.find_backwards_button.setText(_translate("FindDialog", "Find &Backwards"))
        self.close_button.setText(_translate("FindDialog", "Close"))


text:
'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var useStateManager = require('./useStateManager-7748b351.cjs.dev.js');
var _extends = require('@babel/runtime/helpers/extends');
var React = require('react');
var Select = require('./Select-a4936797.cjs.dev.js');
var react = require('@emotion/react');
var createCache = require('@emotion/cache');
var index = require('./index-7bd038ed.cjs.dev.js');
require('@babel/runtime/helpers/objectSpread2');
require('@babel/runtime/helpers/slicedToArray');
require('@babel/runtime/helpers/objectWithoutProperties');
require('@babel/runtime/helpers/classCallCheck');
require('@babel/runtime/helpers/createClass');
require('@babel/runtime/helpers/inherits');
require('@babel/runtime/helpers/createSuper');
require('@babel/runtime/helpers/toConsumableArray');
require('memoize-one');
require('@babel/runtime/helpers/taggedTemplateLiteral');
require('@babel/runtime/helpers/typeof');
require('@babel/runtime/helpers/defineProperty');
require('react-dom');
require('@floating-ui/dom');
require('use-isomorphic-layout-effect');

function _interopDefault (e) { return e && e.__esModule ? e : { 'default': e }; }

function _interopNamespace(e) {
  if (e && e.__esModule) return e;
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () {
            return e[k];
          }
        });
      }
    });
  }
  n['default'] = e;
  return Object.freeze(n);
}

var React__namespace = /*#__PURE__*/_interopNamespace(React);
var createCache__default = /*#__PURE__*/_interopDefault(createCache);

var StateManagedSelect = /*#__PURE__*/React.forwardRef(function (props, ref) {
  var baseSelectProps = useStateManager.useStateManager(props);
  return /*#__PURE__*/React__namespace.createElement(Select.Select, _extends({
    ref: ref
  }, baseSelectProps));
});

var NonceProvider = (function (_ref) {
  var nonce = _ref.nonce,
    children = _ref.children,
    cacheKey = _ref.cacheKey;
  var emotionCache = React.useMemo(function () {
    return createCache__default['default']({
      key: cacheKey,
      nonce: nonce
    });
  }, [cacheKey, nonce]);
  return /*#__PURE__*/React__namespace.createElement(react.CacheProvider, {
    value: emotionCache
  }, children);
});

exports.useStateManager = useStateManager.useStateManager;
exports.createFilter = Select.createFilter;
exports.defaultTheme = Select.defaultTheme;
exports.mergeStyles = Select.mergeStyles;
exports.components = index.components;
exports.NonceProvider = NonceProvider;
exports.default = StateManagedSelect;


text:
function Etape(nom,x,y,struct,suivant,nextPath){
    Etat.call(this,nom,x,y,struct); // super constructor
    this.suivant=suivant;
    this.nextPath=nextPath;
    this.toString = function(){
        return `Etape(${this.nom},${this.suivant})`
    }
}

Etape.prototype.realiser = function(){
    if (this.struct===undefined)
        return this.nom;
    return this.struct()+"";
}

Etape.prototype.getSuivant = function(){return graphe[this.suivant]}

Etape.prototype.lier = function(){
    if (this.nom=="Réfléchissez au prochain problème" ||
        this.nom=="  ATTENDEZ SIX MOIS  " ||
        this.suivant===undefined)return;
    depart=this;
    arrivee=graphe[this.suivant];
    let dx=depart.bbox.x, ax=arrivee.bbox.x;
    let dy=depart.bbox.y, ay=arrivee.bbox.y;
    if (depart.nextPath===undefined){
        if (eq(dy,ay)){ // flèche horizontale
            if (dx<ax) { // d -> a  vers la droite
                this.suivant_path=tracer(depart.bbox,arrivee.bbox,"d")
            } else { // a <- d vers la gauche
                this.suivant_path=tracer(depart.bbox,arrivee.bbox,"g")
            }
        } else if (eq(dx,ax)){ // flèche verticale
            if (dy<ay){ // flèche en bas
                this.suivant_path=tracer(depart.bbox,arrivee.bbox,"b")
            } else {    // fleche en haut
                this.suivant_path=tracer(depart.bbox,arrivee.bbox,"h")
            }
        } else { // faire une flèche par les côtés
            const deltaMinX=Math.abs(dx-minX);
            const deltaMaxX=Math.abs(dx+depart.bbox.width-maxX);
            if (deltaMinX<deltaMaxX){ // vers le minX
                this.suivant_path=tracer(depart.bbox,undefined,"g")
            } else { // vers le maxX
                this.suivant_path=tracer(depart.bbox,undefined,"d")
            }
        }
    } else {
        this.suivant_path=fleche(m(dx+depart.bbox.width/2,dy+depart.bbox.height)+" "+depart.nextPath);
    }
}

Etape.prototype.selectionner = function(oui,select){
    Etat.prototype.selectionner.call(this,select);
    if (this.suivant_path!==undefined)
        this.suivant_path.classed("selected",select)
                         .attr("marker-end","url(#blue-arrow)");
}

extend(Etat,Etape)


text:
<?php

require_once 'config/config.php';
/*
function __autoload($className) {
    require_once CORE_APP . '/classes/' . $className . '.php';
}
 */

spl_autoload_register(function ($className)
{
    $className = ltrim($className, '\\');
    $fileName  = '';
    $namespace = '';
    if ($lastNsPos = strrpos($className, '\\')) {
        $namespace = substr($className, 0, $lastNsPos);
        $className = substr($className, $lastNsPos + 1);
        $fileName  = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
    }

    $fileName = strtolower($fileName);

    $fileName .= str_replace('_', DIRECTORY_SEPARATOR, $className) . '.php';

    require_once BASE_PATH . DIRECTORY_SEPARATOR . $fileName;
});


text:
<!DOCTYPE html>

<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1" />
<title>おえがっき</title>
<meta name="application-name" content="おえがっき" />
<meta name="description" content="自分だけの楽器をつくろう" />
<meta name="keywords" content="おえがっき, HTML5, SVG, ArtSVG.js, ArtSVG, Art SVG, Web Audio API, XSound.js, XSound" />
<meta name="author" content="池田友洋, Tomohiro IKEDA, rilakkuma3xjapan" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<meta name="format-detection" content="telephone=no" />
<link rel="canonical" href="https://korilakkuma.github.io/oegakki/" />
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Architects+Daughter" type="text/css" media="all" />
<link rel="stylesheet" href="lib/js/select2/select2.css" type="text/css" media="all" />
<link rel="stylesheet" href="lib/css/spectrum.css" type="text/css" media="all" />
<link rel="stylesheet" href="stylesheets/css/main.css" type="text/css" media="all" />

            <svg id="svg-300" width="300" height="300"></svg>
            <svg id="svg-600" width="600" height="600"></svg>
            <svg id="svg-900" width="900" height="900"></svg>

            <fieldset id="draw-controller">

                    <select id="select-mode">
                        <option value="path" selected>フリーハンド</option>
                        <option value="rectangle">矩形</option>
                        <option value="circle">円</option>
                        <option value="ellipse">楕円</option>
                        <option value="line">直線</option>
                    </select>
                    <button type="button" id="button-undo"></button>
                    <button type="button" id="button-redo"></button>
                    <button type="button" id="button-clear"></button>

                    <input type="color" id="color-fill" />
                    <input type="color" id="color-stroke" />
                    <input type="range" id="range-stroke-width" value="1" min="0" max="30" step="1" />

            </fieldset>
            <fieldset id="sound-controller">

            </fieldset>


text:
using Deanon.db.datamodels.classes.entities;
using Deanon.db.datamodels.classes.relationships.RelationData;
using Neo4jClient;

namespace Deanon.db.datamodels.classes.relationships
{
    class Friend : Relationship, IRelationshipAllowingSourceNode<Person>, IRelationshipAllowingTargetNode<Person>
    {
        public Friend(NodeReference targetNode, InteractionData data) : base(targetNode, data)
        {

        }

        public override string RelationshipTypeKey
        {
            get
            {
                return "FRIENDS_WITH";
            }
        }
    }
}


text:
.. _menpodetect-opencv-load_opencv_profile_face_detector:

.. currentmodule:: menpodetect.opencv

load_opencv_profile_face_detector
=================================
.. autofunction:: load_opencv_profile_face_detector


text:
layout: post
category: misc
tagline: ""
tags: [misc]
---

## The most moving scene I can remember

watching on a show - there are some things so different in his world, but not long ago I was noticing some of the same things he saw in my nearly 12 year old daughter...  For someone who doesn't even have children Fimmel captured it so well, I can't imagine coming up with such perfect words - it is too horrible to comtemplate being in this situation.  -chris

<iframe width="560" height="315" src="https://www.youtube.com/embed/SLyQKEemFfE" frameborder="0" allowfullscreen></iframe>


text:
'use strict';

(function() {

  /**
   * @ngdoc service
   * @name  Cache
   * @requires  angular-data.DSCacheFactory
   * @description
   */
  function CacheFactory(DSCacheFactory) {
    var dataCache = new DSCacheFactory('data');

    return {
      Data:{
        set: function(key, value) {
          dataCache.put(key, angular.copy(value));
        },
        get: function(key) {
          return (dataCache.get(key)) ? angular.copy(dataCache.get(key)) : null;
        },
        delete: function(key) {
          dataCache.remove(key);
        }
      }
    };
  }

  angular.module('<%= appName %>.cache')
    .factory('Cache', CacheFactory);

})();


text:
The Bootstrap team and community take security issues in Bootstrap seriously. We appreciate your efforts to responsibly disclose your findings, and will make every effort to acknowledge your contributions.

To report a security issue, email [security@getbootstrap.com](mailto:security@getbootstrap.com) and include the word "SECURITY" in the subject line.

We'll endeavor to respond quickly, and will keep you updated throughout the process.


text:
extern FILE* logfd;
//Debug macros
#define DPRINTF(args...) \
do \
{ \
    fprintf(logfd, "------------\n%s:%s:%d\n",__func__,__FILE__,__LINE__); \
    fprintf(logfd, args); \
    fprintf(logfd, "\n------------\n"); \
} while(0)

//Macros for generating typedefs for directdraw apis
#define DDTYPEDEF(rtype, iface, name,args...)\
typedef rtype (STDMETHODCALLTYPE *iface##name##Ptr)(args);

#define STDDDTYPEDEF(iface, name, args...)\
DDTYPEDEF(HRESULT, iface, name, args)

#define DDSTUB(rtype, iface, name, args...) \
rtype STDMETHODCALLTYPE iface##name(args) \
{ \
    DPRINTF("call to unimplemented function. Aborting."); \
    ABORT(); \
    return 0; \
}

#define ABORT() \
do {DPRINTF("---------------aborting"); int* i = 0; memset(i,1,1000); abort(); } while(0)

#define STDDDSTUB(iface, name, args...) \
DDSTUB(HRESULT, iface, name, args);

void PrintSurfaceDesc(DDSURFACEDESC* desc);
void PrintHresult(HRESULT h);
void PrintRenderstate(D3DRENDERSTATETYPE rs, DWORD val);
void PrintRect(RECT* r);
#endif


text:
package org.apache.flink.streaming.api.functions.sink;

import java.io.PrintStream;

import org.apache.flink.annotation.PublicEvolving;
import org.apache.flink.configuration.Configuration;
import org.apache.flink.streaming.api.operators.StreamingRuntimeContext;

/**
 * Implementation of the SinkFunction writing every tuple to the standard
 * output or standard error stream.
 *
 * @param <IN>
 *            Input record type
 */
@PublicEvolving
public class PrintSinkFunction<IN> extends RichSinkFunction<IN> {
	private static final long serialVersionUID = 1L;

	private static final boolean STD_OUT = false;
	private static final boolean STD_ERR = true;

	private boolean target;
	private transient PrintStream stream;
	private transient String prefix;

	/**
	 * Instantiates a print sink function that prints to standard out.
	 */
	public PrintSinkFunction() {}

	/**
	 * Instantiates a print sink function that prints to standard out.
	 *
	 * @param stdErr True, if the format should print to standard error instead of standard out.
	 */
	public PrintSinkFunction(boolean stdErr) {
		target = stdErr;
	}

	public void setTargetToStandardOut() {
		target = STD_OUT;
	}

	public void setTargetToStandardErr() {
		target = STD_ERR;
	}

	@Override
	public void open(Configuration parameters) throws Exception {
		super.open(parameters);
		StreamingRuntimeContext context = (StreamingRuntimeContext) getRuntimeContext();
		// get the target stream
		stream = target == STD_OUT ? System.out : System.err;

		// set the prefix if we have a >1 parallelism
		prefix = (context.getNumberOfParallelSubtasks() > 1) ?
				((context.getIndexOfThisSubtask() + 1) + "> ") : null;
	}

	@Override
	public void invoke(IN record) {
		if (prefix != null) {
			stream.println(prefix + record.toString());
		}
		else {
			stream.println(record.toString());
		}
	}

	@Override
	public void close() {
		this.stream = null;
		this.prefix = null;
	}

	@Override
	public String toString() {
		return "Print to " + (target == STD_OUT ? "System.out" : "System.err");
	}
}


text:
#define PYCOSAT_URL  "https://pypi.python.org/pypi/pycosat"
#define PYCOSAT_VERSION  "0.6.3"

#include <Python.h>

#ifdef _MSC_VER
#define NGETRUSAGE
#define inline __inline
#endif

#include "picosat.h"
#ifndef DONT_INCLUDE_PICOSAT
#include "picosat.c"
#endif

/* When defined, picosat uses the Python memory manager
   We cannot do this while we:
   "release GIL during main picosat computation"
   https://github.com/ContinuumIO/pycosat/commit/f50c89a10db2e87c3e6b896c43ce0549f92039d0
   I am assuming here that we would rather release the GIL than use the Python mem allocation
   though there is no comments to explain the trade-offs between the Python vs libc allocators
*/
/* #define WITH_PYMEM */

#if PY_MAJOR_VERSION >= 3
#define IS_PY3K
#endif

#ifdef IS_PY3K
#define PyInt_FromLong  PyLong_FromLong
#define IS_INT(x)  (PyLong_Check(x))
#else
#define IS_INT(x)  (PyInt_Check(x) || PyLong_Check(x))
#endif

#if PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 5
#define PyUnicode_FromString  PyString_FromString
#endif

#if defined(WITH_PYMEM)
/* the following three adapter functions are used as arguments to
   picosat_minit, such that picosat used the Python memory manager */
inline static void *py_malloc(void *mmgr, size_t bytes)
{
    return PyMem_Malloc(bytes);
}

inline static void *py_realloc(void *mmgr, void *ptr, size_t old, size_t new)
{
    return PyMem_Realloc(ptr, new);
}

inline static void py_free(void *mmgr, void *ptr, size_t bytes)
{
    PyMem_Free(ptr);
}
#endif

/* Add the inverse of the (current) solution to the clauses.
   This function is essentially the same as the function blocksol in app.c
   in the picosat source. */
static int blocksol(PicoSAT *picosat, signed char *mem)
{
    int max_idx, i;

    max_idx = picosat_variables(picosat);
    if (mem == NULL) {
        mem = PyMem_Malloc(max_idx + 1);
        if (mem == NULL) {
            PyErr_NoMemory();
            return -1;
        }
    }
    for (i = 1; i <= max_idx; i++)
        mem[i] = (picosat_deref(picosat, i) > 0) ? 1 : -1;

    for (i = 1; i <= max_idx; i++)
        picosat_add(picosat, (mem[i] < 0) ? i : -i);

    picosat_add(picosat, 0);
    return 0;
}

static int add_clause(PicoSAT *picosat, PyObject *clause)
{
    PyObject *iterator;         /* each clause is an iterable of literals */
    PyObject *lit;              /* the literals are integers */
    int v;

    iterator = PyObject_GetIter(clause);
    if (iterator == NULL)
        return -1;

    while ((lit = PyIter_Next(iterator)) != NULL) {
        if (!IS_INT(lit))  {
            Py_DECREF(lit);
            Py_DECREF(iterator);
            PyErr_SetString(PyExc_TypeError, "integer expected");
            return -1;
        }
        v = PyLong_AsLong(lit);
        Py_DECREF(lit);
        if (v == 0) {
            Py_DECREF(iterator);
            PyErr_SetString(PyExc_ValueError, "non-zero integer expected");
            return -1;
        }
        picosat_add(picosat, v);
    }
    Py_DECREF(iterator);
    if (PyErr_Occurred())
        return -1;
    picosat_add(picosat, 0);
    return 0;
}

static int add_clauses(PicoSAT *picosat, PyObject *clauses)
{
    PyObject *iterator;       /* clauses can be any iterable */
    PyObject *item;           /* each clause is an iterable of integers */

    iterator = PyObject_GetIter(clauses);
    if (iterator == NULL)
        return -1;

    while ((item = PyIter_Next(iterator)) != NULL) {
        if (add_clause(picosat, item) < 0) {
            Py_DECREF(item);
            Py_DECREF(iterator);
            return -1;
        }
        Py_DECREF(item);
    }
    Py_DECREF(iterator);
    if (PyErr_Occurred())
        return -1;
    return 0;
}

static PicoSAT* setup_picosat(PyObject *args, PyObject *kwds)
{
    PicoSAT *picosat;
    PyObject *clauses;          /* iterable of clauses */
    int vars = -1, verbose = 0;
    unsigned long long prop_limit = 0;
    static char* kwlist[] = {"clauses",
                             "vars", "verbose", "prop_limit", NULL};

    if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|iiK:(iter)solve", kwlist,
                                     &clauses,
                                     &vars, &verbose, &prop_limit))
        return NULL;

#if defined(WITH_PYMEM)
    picosat = picosat_minit(NULL, py_malloc, py_realloc, py_free);
#else
    picosat = picosat_init();
#endif
    picosat_set_verbosity(picosat, verbose);
    if (vars != -1)
        picosat_adjust(picosat, vars);

    if (prop_limit)
        picosat_set_propagation_limit(picosat, prop_limit);

    if (add_clauses(picosat, clauses) < 0) {
        picosat_reset(picosat);
        return NULL;
    }

    if (verbose >= 2)
        picosat_print(picosat, stdout);

    return picosat;
}

/* read the solution from the picosat object and return a Python list */
static PyObject* get_solution(PicoSAT *picosat)
{
    PyObject *list;
    int max_idx, i, v;

    max_idx = picosat_variables(picosat);
    list = PyList_New((Py_ssize_t) max_idx);
    if (list == NULL) {
        picosat_reset(picosat);
        return NULL;
    }
    for (i = 1; i <= max_idx; i++) {
        v = picosat_deref(picosat, i);
        assert(v == -1 || v == 1);
        if (PyList_SetItem(list, (Py_ssize_t) (i - 1),
                           PyInt_FromLong((long) (v * i))) < 0) {
            Py_DECREF(list);
            picosat_reset(picosat);
            return NULL;
        }
    }
    return list;
}

static PyObject* solve(PyObject *self, PyObject *args, PyObject *kwds)
{
    PicoSAT *picosat;
    PyObject *result = NULL;    /* return value */
    int res;

    picosat = setup_picosat(args, kwds);
    if (picosat == NULL)
        return NULL;

    Py_BEGIN_ALLOW_THREADS      /* release GIL */
    res = picosat_sat(picosat, -1);
    Py_END_ALLOW_THREADS

    switch (res) {
    case PICOSAT_SATISFIABLE:
        result = get_solution(picosat);
        break;

    case PICOSAT_UNSATISFIABLE:
        result = PyUnicode_FromString("UNSAT");
        break;

    case PICOSAT_UNKNOWN:
        result = PyUnicode_FromString("UNKNOWN");
        break;

    default:
        PyErr_Format(PyExc_SystemError, "picosat return value: %d", res);
    }

    picosat_reset(picosat);
    return result;
}

PyDoc_STRVAR(solve_doc,
"solve(clauses [, kwargs]) -> list\n\
\n\
Solve the SAT problem for the clauses, and return a solution as a\n\
list of integers, or one of the strings \"UNSAT\", \"UNKNOWN\".\n\
Please see " PYCOSAT_URL " for more details.");

/*********************** Solution Iterator *********************/

typedef struct {
    PyObject_HEAD
    PicoSAT *picosat;
    signed char *mem;           /* temporary storage */
} soliterobject;

static PyTypeObject SolIter_Type;

#define SolIter_Check(op)  PyObject_TypeCheck(op, &SolIter_Type)

static PyObject* itersolve(PyObject *self, PyObject *args, PyObject *kwds)
{
    soliterobject *it;          /* iterator to be returned */

    it = PyObject_GC_New(soliterobject, &SolIter_Type);
    if (it == NULL)
        return NULL;

    it->picosat = setup_picosat(args, kwds);
    if (it->picosat == NULL)
        return NULL;

    it->mem = NULL;
    PyObject_GC_Track(it);
    return (PyObject *) it;
}

PyDoc_STRVAR(itersolve_doc,
"itersolve(clauses [, kwargs]) -> iterator\n\
\n\
Solve the SAT problem for the clauses, and return an iterator over\n\
the solutions (which are lists of integers).\n\
Please see " PYCOSAT_URL " for more details.");

static PyObject* soliter_next(soliterobject *it)
{
    PyObject *result = NULL;    /* return value */
    int res;

    assert(SolIter_Check(it));

    Py_BEGIN_ALLOW_THREADS      /* release GIL */
    res = picosat_sat(it->picosat, -1);
    Py_END_ALLOW_THREADS

    switch (res) {
    case PICOSAT_SATISFIABLE:
        result = get_solution(it->picosat);
        if (result == NULL) {
            PyErr_SetString(PyExc_SystemError, "failed to create list");
            return NULL;
        }
        /* add inverse solution to the clauses, for next iteration */
        if (blocksol(it->picosat, it->mem) < 0)
            return NULL;
        break;

    case PICOSAT_UNSATISFIABLE:
    case PICOSAT_UNKNOWN:
        /* no more solutions -- stop iteration */
        break;

    default:
        PyErr_Format(PyExc_SystemError, "picosat return value: %d", res);
    }
    return result;
}

static void soliter_dealloc(soliterobject *it)
{
    PyObject_GC_UnTrack(it);
    if (it->mem)
        PyMem_Free(it->mem);
    picosat_reset(it->picosat);
    PyObject_GC_Del(it);
}

static int soliter_traverse(soliterobject *it, visitproc visit, void *arg)
{
    return 0;
}

static PyTypeObject SolIter_Type = {
#ifdef IS_PY3K
    PyVarObject_HEAD_INIT(NULL, 0)
#else
    PyObject_HEAD_INIT(NULL)
    0,                                        /* ob_size */
#endif
    "soliterator",                            /* tp_name */
    sizeof(soliterobject),                    /* tp_basicsize */
    0,                                        /* tp_itemsize */
    /* methods */
    (destructor) soliter_dealloc,             /* tp_dealloc */
    0,                                        /* tp_print */
    0,                                        /* tp_getattr */
    0,                                        /* tp_setattr */
    0,                                        /* tp_compare */
    0,                                        /* tp_repr */
    0,                                        /* tp_as_number */
    0,                                        /* tp_as_sequence */
    0,                                        /* tp_as_mapping */
    0,                                        /* tp_hash */
    0,                                        /* tp_call */
    0,                                        /* tp_str */
    PyObject_GenericGetAttr,                  /* tp_getattro */
    0,                                        /* tp_setattro */
    0,                                        /* tp_as_buffer */
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,  /* tp_flags */
    0,                                        /* tp_doc */
    (traverseproc) soliter_traverse,          /* tp_traverse */
    0,                                        /* tp_clear */
    0,                                        /* tp_richcompare */
    0,                                        /* tp_weaklistoffset */
    PyObject_SelfIter,                        /* tp_iter */
    (iternextfunc) soliter_next,              /* tp_iternext */
    0,                                        /* tp_methods */
};

/*************************** Method definitions *************************/

/* declaration of methods supported by this module */
static PyMethodDef module_functions[] = {
    {"solve",     (PyCFunction) solve,     METH_VARARGS | METH_KEYWORDS,
      solve_doc},
    {"itersolve", (PyCFunction) itersolve, METH_VARARGS | METH_KEYWORDS,
      itersolve_doc},
    {NULL,        NULL}  /* sentinel */
};

PyDoc_STRVAR(module_doc, "\
pycosat: bindings to PicoSAT\n\
============================\n\n\
There are two functions in this module, solve and itersolve.\n\
Please see " PYCOSAT_URL " for more details.");

/* initialization routine for the shared library */
#ifdef IS_PY3K
static PyModuleDef moduledef = {
    PyModuleDef_HEAD_INIT, "pycosat", module_doc, -1, module_functions,
};
PyMODINIT_FUNC PyInit_pycosat(void)
#else
PyMODINIT_FUNC initpycosat(void)
#endif
{
    PyObject *m;

#ifdef IS_PY3K
    if (PyType_Ready(&SolIter_Type) < 0)
        return NULL;
    m = PyModule_Create(&moduledef);
    if (m == NULL)
        return NULL;
#else
    if (PyType_Ready(&SolIter_Type) < 0)
        return;
    m = Py_InitModule3("pycosat", module_functions, module_doc);
    if (m == NULL)
        return;
#endif

    PyModule_AddObject(m, "__version__",
                       PyUnicode_FromString(PYCOSAT_VERSION));

#ifdef IS_PY3K
    return m;
#endif
}


text:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
	<modelVersion>4.0.0</modelVersion>
	<groupId>dta</groupId>
	<artifactId>bankonet-web</artifactId>
	<version>1.0</version>
	<packaging>war</packaging>
	<build>
		<pluginManagement>
			<plugins>
				<plugin>
					<groupId>org.apache.tomcat.maven</groupId>
					<artifactId>tomcat6-maven-plugin</artifactId>
					<version>2.2</version>
				</plugin>
				<plugin>
					<groupId>org.apache.tomcat.maven</groupId>
					<artifactId>tomcat7-maven-plugin</artifactId>
					<version>2.2</version>
				</plugin>
				<plugin>
					<artifactId>maven-compiler-plugin</artifactId>
					<configuration>
						<source>1.8</source>
						<target>1.8</target>
					</configuration>
				</plugin>
			</plugins>
		</pluginManagement>
	</build>
</project>


text:
using Orchard.Localization;
using Orchard.Security;
using Orchard.UI.Navigation;

namespace Orchard.Workflows {
    public class AdminMenu : INavigationProvider {
        public Localizer T { get; set; }
        public string MenuName { get { return "admin"; } }

        public void GetNavigation(NavigationBuilder builder) {
            builder
                .AddImageSet("workflows")
                .Add(T("Workflows"), "10",
                    menu => menu
                        .Add(T("Workflows"), "1.0",
                            qi => qi.Action("Index", "Admin", new {area = "Orchard.Workflows"}).Permission(StandardPermissions.SiteOwner).LocalNav()),
                    new[] {"network"}
                );
        }
    }
}


text:
package blackboard.plugin.hayabusa.provider;

import java.util.List;
import java.util.Set;

import blackboard.data.navigation.NavigationItem;
import blackboard.data.navigation.NavigationItemControl;
import blackboard.persist.PersistenceException;
import blackboard.persist.PersistenceRuntimeException;
import blackboard.persist.navigation.NavigationItemDbLoader;
import blackboard.platform.context.ContextManagerFactory;
import blackboard.plugin.hayabusa.command.Category;
import blackboard.plugin.hayabusa.command.Command;
import blackboard.plugin.hayabusa.command.SimpleCommand;
import blackboard.portal.data.Module;
import blackboard.portal.persist.ModuleDbLoader;
import blackboard.portal.view.FramesetUtil;

import com.google.common.collect.Lists;
import com.google.common.collect.Sets;

/**
 * A {@link Provider} for ADMIN EMAIL COMMANDS.
 *
 * @author ZHAOXIA YANG
 * @since 1.0
 */
public class UserManagerProvider implements Provider
{

  private static final String INTERNAL_HANDLER = "list_users";

  @Override
  public Iterable<Command> getCommands()
  {
    try
    {
      // TODO wire these dependencies as fields/constructor inject
      NavigationItemDbLoader niLoader = NavigationItemDbLoader.Default.getInstance();
      ModuleDbLoader moduleLoader = ModuleDbLoader.Default.getInstance();
      Module module = moduleLoader.loadByExtRef( "platform/admin-users" );

      NavigationItemControl family = NavigationItemControl.createInstance( niLoader
          .loadByInternalHandle( INTERNAL_HANDLER ) );

      // For admin
      List<NavigationItemControl> userAdminNics = getUserAdminNics();
      Set<Command> commands = Sets.newTreeSet();

      for ( NavigationItemControl nic : userAdminNics )
      {
        if ( !nic.userHasAccess() )
        {
          continue;
        }
        String title = String.format( "%s - %s: %s", module.getTitle(), family.getLabel(), nic.getLabel() );
        String url = processUri( nic );
        url = FramesetUtil.getTabGroupUrl(blackboard.data.navigation.Tab.TabType.admin, url);
        commands.add( new SimpleCommand( title, url, Category.SYSTEM_ADMIN ) );
      }

      List<NavigationItemControl> personalEditNics = getPersonalEditNics();

      for ( NavigationItemControl nic : personalEditNics )
      {
        if ( !nic.userHasAccess() )
        {
          continue;
        }
        String title = String.format( "%s: %s", family.getLabel(), nic.getLabel() );
        String uri = processUri( nic );
        uri = FramesetUtil.getTabGroupUrl(blackboard.data.navigation.Tab.TabType.my_institution, uri);
       commands.add( new SimpleCommand( title, uri, Category.USER ) );
      }
      return commands;
    }
    catch ( PersistenceException e )
    {
      throw new PersistenceRuntimeException( e );
    }
  }

  private String processUri( NavigationItemControl nic )
  {
    String uri = nic.getUrl();
    blackboard.platform.context.Context ctx = ContextManagerFactory.getInstance().getContext();
    uri = uri.replaceAll( "@X@target_user.pk_string@X@", ctx.getUserId().getExternalString() );
    return uri;
  }

  private List<NavigationItemControl> getPersonalEditNics() throws PersistenceException
  {
    NavigationItemDbLoader niLoader = NavigationItemDbLoader.Default.getInstance();
    // For Personal Info Edit
    List<NavigationItem> personalEditNis = Lists.newArrayList( niLoader.loadByInternalHandle( "my_inst_personal_edit" ),
                                                               niLoader.loadByInternalHandle( "my_inst_personal_change_password" ) );
    List<NavigationItemControl> personalEditNics = NavigationItemControl.createList( personalEditNis );
    return personalEditNics;
  }

  private List<NavigationItemControl> getUserAdminNics() throws PersistenceException
  {
    NavigationItemDbLoader niLoader = NavigationItemDbLoader.Default.getInstance();
    // For admin
    List<NavigationItem> userAdminNis = Lists.newArrayList( niLoader.loadByInternalHandle( "create_user" ),
                                                            niLoader.loadByInternalHandle( "batch_create_users" ),
                                                            niLoader.loadByInternalHandle( "batch_remove_users" ) );
    List<NavigationItemControl> userAdminNics = NavigationItemControl.createList( userAdminNis );
    return userAdminNics;
  }
}


text:
<component name="libraryTable">
  <library name="support-core-ui-24.2.0">
    <ANNOTATIONS>
      <root url="jar://$PROJECT_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.0/annotations.zip!/" />
    </ANNOTATIONS>
    <CLASSES>
      <root url="jar://$PROJECT_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.0/jars/classes.jar!/" />
      <root url="file://$PROJECT_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.0/res" />
      <root url="jar://$PROJECT_DIR$/build/intermediates/exploded-aar/com.android.support/support-core-ui/24.2.0/jars/libs/internal_impl-24.2.0.jar!/" />
    </CLASSES>
    <JAVADOC />
    <SOURCES>
      <root url="jar://$USER_HOME$/Downloads/adt-bundle-mac-x86_64-20131030/sdk/extras/android/m2repository/com/android/support/support-core-ui/24.2.0/support-core-ui-24.2.0-sources.jar!/" />
    </SOURCES>
  </library>
</component>


text:
<?php

namespace Symfony\Component\Messenger;

/**
 * A message wrapped in an envelope with items (configurations, markers, ...).
 *
 * @author Maxime Steinhausser <maxime.steinhausser@gmail.com>
 */
final class Envelope
{
    private $items = array();
    private $message;

    /**
     * @param object                  $message
     * @param EnvelopeItemInterface[] $items
     */
    public function __construct($message, array $items = array())
    {
        $this->message = $message;
        foreach ($items as $item) {
            $this->items[\get_class($item)] = $item;
        }
    }

    /**
     * Wrap a message into an envelope if not already wrapped.
     *
     * @param Envelope|object $message
     */
    public static function wrap($message): self
    {
        return $message instanceof self ? $message : new self($message);
    }

    /**
     * @return Envelope a new Envelope instance with additional item
     */
    public function with(EnvelopeItemInterface $item): self
    {
        $cloned = clone $this;

        $cloned->items[\get_class($item)] = $item;

        return $cloned;
    }

    public function withMessage($message): self
    {
        $cloned = clone $this;

        $cloned->message = $message;

        return $cloned;
    }

    public function get(string $itemFqcn): ?EnvelopeItemInterface
    {
        return $this->items[$itemFqcn] ?? null;
    }

    /**
     * @return EnvelopeItemInterface[] indexed by fqcn
     */
    public function all(): array
    {
        return $this->items;
    }

    /**
     * @return object The original message contained in the envelope
     */
    public function getMessage()
    {
        return $this->message;
    }

    /**
     * @param object $target
     *
     * @return Envelope|object The original message or the envelope if the target supports it
     *                         (i.e implements {@link EnvelopeAwareInterface}).
     */
    public function getMessageFor($target)
    {
        return $target instanceof EnvelopeAwareInterface ? $this : $this->message;
    }
}


text:
import $dom from '../dom.js';

export default {

    getElementById(id) {
        // https://dom.spec.whatwg.org/#dom-nonelementparentnode-getelementbyid

        if (id === '' || /\s/.test(id)) {
            return null;
        }

        const firstChild = this.firstChild;

        if (!firstChild) {
            return null;
        }

        return $dom.treeOrderRecursiveSelectFirst(firstChild, function (node) {
            return node.id === id;
        });
    },

};


text:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:f="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#f1f3f6"
    android:orientation="vertical">

    <include layout="@layout/top_bar" />

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_margin="10dp"
            android:background="@drawable/bg_edit_userinfo"
            android:orientation="vertical">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:visibility="visible">

                <ImageView
                    android:layout_width="20dp"
                    android:layout_height="20dp"
                    android:layout_margin="10dp"
                    android:scaleType="fitCenter"
                    android:src="@drawable/mine_edit" />

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    android:gravity="center_vertical"
                    android:text="个人资料"
                    android:textColor="#646464"
                    android:textSize="14sp" />
            </LinearLayout>

            <RelativeLayout
                android:id="@+id/rl_changephoto"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:visibility="visible">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_centerVertical="true"
                    android:layout_marginLeft="40dp"
                    android:text="更换头像"
                    android:textColor="#646464"
                    android:textSize="14sp" />

                <com.miaotu.view.CircleImageView
                    android:id="@+id/iv_head_photo"
                    android:layout_width="60dp"
                    android:layout_height="60dp"
                    android:layout_alignParentRight="true"
                    android:layout_marginRight="20dp"
                    android:src="@drawable/default_avatar" />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="30dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="10dp"
                android:visibility="visible"
                android:background="@drawable/bg_edittext">

                <TextView
                    android:id="@+id/tv_nickname"
                    android:layout_width="67dp"
                    android:layout_height="30dp"
                    android:gravity="center"
                    android:text="昵称"
                    android:textColor="#b4b4b4"
                    android:textSize="12sp" />

                <View
                    android:id="@+id/view1"
                    android:layout_width="1dp"
                    android:layout_height="20dp"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@id/tv_nickname"
                    android:background="#dcdcdc" />

                <EditText
                    android:id="@+id/et_nickname"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/view1"
                    android:background="#f1f1f1"
                    android:gravity="center_vertical"
                    android:maxLength="8"
                    android:hint="请输入您的昵称"
                    android:textColorHint="#b4b4b4"
                    android:textColor="#646464"
                    android:textSize="14sp" />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="30dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="10dp"
                android:visibility="visible"
                android:background="@drawable/bg_edittext">

                <TextView
                    android:id="@+id/tv_title_gender"
                    android:layout_width="67dp"
                    android:layout_height="30dp"
                    android:gravity="center"
                    android:text="性别"
                    android:textColor="#b4b4b4"
                    android:textSize="12sp" />

                <View
                    android:id="@+id/view2"
                    android:layout_width="1dp"
                    android:layout_height="20dp"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@id/tv_title_gender"
                    android:background="#dcdcdc" />

                <TextView
                    android:id="@+id/tv_gender"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/view2"
                    android:background="#f1f1f1"
                    android:gravity="center_vertical"
                    android:hint="请选择您的性别"
                    android:textColorHint="#b4b4b4"
                    android:textColor="#646464"
                    android:textSize="14sp" />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="30dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="10dp"
                android:background="@drawable/bg_edittext">

                <TextView
                    android:id="@+id/tv_title_age"
                    android:layout_width="67dp"
                    android:layout_height="30dp"
                    android:gravity="center"
                    android:text="年龄"
                    android:textColor="#b4b4b4"
                    android:textSize="12sp" />

                <View
                    android:id="@+id/view3"
                    android:layout_width="1dp"
                    android:layout_height="20dp"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@id/tv_title_age"
                    android:background="#dcdcdc" />

                <TextView
                    android:id="@+id/tv_age"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/view3"
                    android:background="#f1f1f1"
                    android:gravity="center_vertical"
                    android:hint="请选择您的年龄"
                    android:textColorHint="#b4b4b4"
                    android:text=""
                    android:textColor="#646464"
                    android:textSize="14sp" />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="30dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="20dp"
                android:background="@drawable/bg_edittext">

                <TextView
                    android:id="@+id/tv_title_address"
                    android:layout_width="67dp"
                    android:layout_height="30dp"
                    android:gravity="center"
                    android:text="所在地"
                    android:textColor="#b4b4b4"
                    android:textSize="12sp" />

                <View
                    android:id="@+id/view4"
                    android:layout_width="1dp"
                    android:layout_height="20dp"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@id/tv_title_address"
                    android:background="#dcdcdc" />

                <TextView
                    android:id="@+id/tv_address"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/view4"
                    android:background="#f1f1f1"
                    android:gravity="center_vertical"
                    android:hint="请选择您的所在地"
                    android:textColorHint="#b4b4b4"
                    android:textColor="#646464"
                    android:textSize="14sp" />
            </RelativeLayout>

            <View
                android:layout_width="match_parent"
                android:layout_height="1dp"
                android:layout_marginTop="20dp"
                android:background="@drawable/bg_line" />

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="30dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="10dp"
                android:background="@drawable/bg_edittext">

                <TextView
                    android:id="@+id/tv_emotion"
                    android:layout_width="67dp"
                    android:layout_height="30dp"
                    android:gravity="center"
                    android:text="情感状态"
                    android:textColor="#b4b4b4"
                    android:textSize="12sp" />

                <View
                    android:id="@+id/view5"
                    android:layout_width="1dp"
                    android:layout_height="20dp"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@id/tv_emotion"
                    android:background="#dcdcdc" />

                <EditText
                    android:id="@+id/et_emotion"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/view5"
                    android:background="#f1f1f1"
                    android:gravity="center_vertical"
                    android:hint="请输入您的情感状态"
                    android:textColorHint="#b4b4b4"
                    android:textColor="#646464"
                    android:textSize="14sp"
                    android:maxLength="10"
                    />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="30dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="10dp"
                android:background="@drawable/bg_edittext">

                <TextView
                    android:id="@+id/tv_job"
                    android:layout_width="67dp"
                    android:layout_height="30dp"
                    android:gravity="center"
                    android:text="职业"
                    android:textColor="#b4b4b4"
                    android:textSize="12sp" />

                <View
                    android:id="@+id/view6"
                    android:layout_width="1dp"
                    android:layout_height="20dp"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@id/tv_job"
                    android:background="#dcdcdc" />

                <EditText
                    android:id="@+id/et_job"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/view6"
                    android:background="#f1f1f1"
                    android:gravity="center_vertical"
                    android:hint="请输入您的职业"
                    android:textColorHint="#b4b4b4"
                    android:textColor="#646464"
                    android:textSize="14sp"
                    android:maxLength="15"
                    />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="30dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="10dp"
                android:background="@drawable/bg_edittext">

                <TextView
                    android:id="@+id/tv_wantgo"
                    android:layout_width="67dp"
                    android:layout_height="30dp"
                    android:gravity="center"
                    android:text="想去"
                    android:textColor="#b4b4b4"
                    android:textSize="12sp" />

                <View
                    android:id="@+id/view7"
                    android:layout_width="1dp"
                    android:layout_height="20dp"
                    android:layout_centerVertical="true"
                    android:layout_toRightOf="@id/tv_wantgo"
                    android:background="#dcdcdc" />

                <EditText
                    android:id="@+id/et_wantgo"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/view7"
                    android:background="#f1f1f1"
                    android:gravity="center_vertical"
                    android:hint="请输入您想去的地方"
                    android:textColorHint="#b4b4b4"
                    android:textColor="#646464"
                    android:textSize="14sp"
                    android:maxLength="20"
                    />
            </RelativeLayout>

            <RelativeLayout
                android:layout_width="match_parent"
                android:layout_height="30dp"
                android:layout_marginLeft="30dp"
                android:layout_marginRight="20dp"
                android:layout_marginTop="10dp">

                <EditText
                    android:id="@+id/et_tag"
                    android:layout_width="150dp"
                    android:layout_height="match_parent"
                    android:background="@drawable/bg_edittext"
                    android:paddingLeft="10dp"
                    android:maxLength="8"
                    android:hint="请添加您的标签"
                    android:textColor="#b4b4b4"
                    android:textSize="12sp" />

                <Button
                    android:id="@+id/btn_add"
                    android:layout_width="50dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="10dp"
                    android:layout_toRightOf="@id/et_tag"
                    android:background="@drawable/bg_add"
                    android:text="添加"
                    android:textColor="@android:color/white"
                    android:textSize="16sp" />
            </RelativeLayout>

            <com.miaotu.view.FlowLayout
                android:id="@+id/fl_tags"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginLeft="30dp"
                android:layout_marginTop="20dp"
                android:orientation="horizontal"
                f:debugDraw="true"
                f:layoutDirection="ltr"
                f:weightDefault="1.0">

                <!--<include layout="@layout/item_tag" />-->
            </com.miaotu.view.FlowLayout>

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="30dp"
                android:layout_marginTop="20dp"
                android:text="热门标签"
                android:textColor="#dcdcdc"
                android:textSize="14sp"
                android:visibility="gone"/>

            <com.miaotu.view.FlowLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginBottom="20dp"
                android:layout_marginLeft="30dp"
                android:layout_marginTop="10dp"
                f:debugDraw="true"
                f:layoutDirection="ltr"
                f:weightDefault="1.0"
                android:visibility="gone">
                <include layout="@layout/item_hottag" />
                <include layout="@layout/item_hottag" />

            </com.miaotu.view.FlowLayout>
        </LinearLayout>
    </ScrollView>
</LinearLayout>


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Nat. Arr. Brit. Pl. (London) 1: (1821)

#### Original name
Lecidea privigna Ach.

### Remarks
null


text:
package proxy

import (
	"context"
	"net"
	"time"

	"github.com/coredns/coredns/request"

	"github.com/miekg/dns"
)

type dnsEx struct {
	Timeout time.Duration
	Options
}

// Options define the options understood by dns.Exchange.
type Options struct {
	ForceTCP bool // If true use TCP for upstream no matter what
}

func newDNSEx() *dnsEx {
	return newDNSExWithOption(Options{})
}

func newDNSExWithOption(opt Options) *dnsEx {
	return &dnsEx{Timeout: defaultTimeout * time.Second, Options: opt}
}

func (d *dnsEx) Protocol() string          { return "dns" }
func (d *dnsEx) OnShutdown(p *Proxy) error { return nil }
func (d *dnsEx) OnStartup(p *Proxy) error  { return nil }

// Exchange implements the Exchanger interface.
func (d *dnsEx) Exchange(ctx context.Context, addr string, state request.Request) (*dns.Msg, error) {
	proto := state.Proto()
	if d.Options.ForceTCP {
		proto = "tcp"
	}
	co, err := net.DialTimeout(proto, addr, d.Timeout)
	if err != nil {
		return nil, err
	}

	reply, _, err := d.ExchangeConn(state.Req, co)

	co.Close()

	if reply != nil && reply.Truncated {
		// Suppress proxy error for truncated responses
		err = nil
	}

	if err != nil {
		return nil, err
	}
	// Make sure it fits in the DNS response.
	reply, _ = state.Scrub(reply)
	reply.Compress = true
	reply.Id = state.Req.Id

	return reply, nil
}

func (d *dnsEx) ExchangeConn(m *dns.Msg, co net.Conn) (*dns.Msg, time.Duration, error) {
	start := time.Now()
	r, err := exchange(m, co)
	rtt := time.Since(start)

	return r, rtt, err
}

func exchange(m *dns.Msg, co net.Conn) (*dns.Msg, error) {
	opt := m.IsEdns0()

	udpsize := uint16(dns.MinMsgSize)
	// If EDNS0 is used use that for size.
	if opt != nil && opt.UDPSize() >= dns.MinMsgSize {
		udpsize = opt.UDPSize()
	}

	dnsco := &dns.Conn{Conn: co, UDPSize: udpsize}

	writeDeadline := time.Now().Add(defaultTimeout)
	dnsco.SetWriteDeadline(writeDeadline)
	dnsco.WriteMsg(m)

	readDeadline := time.Now().Add(defaultTimeout)
	co.SetReadDeadline(readDeadline)
	r, err := dnsco.ReadMsg()

	dnsco.Close()
	if r == nil {
		return nil, err
	}
	return r, err
}


text:
require 'spec_helper'

RSpec.describe IssuePresenter do
  include Gitlab::Routing.url_helpers

  let(:user)      { create(:user) }
  let(:group)     { create(:group) }
  let(:project)   { create(:project, group: group) }
  let(:issue)     { create(:issue, project: project) }
  let(:presenter) { described_class.new(issue, current_user: user) }

  before do
    group.add_developer(user)
  end

  describe '#web_url' do
    it 'returns correct path' do
      expect(presenter.web_url).to eq("http://localhost/#{group.name}/#{project.name}/-/issues/#{issue.iid}")
    end
  end

  describe '#subscribed?' do
    subject { presenter.subscribed? }

    it 'returns not subscribed' do
      is_expected.to be(false)
    end

    it 'returns subscribed' do
      create(:subscription, user: user, project: project, subscribable: issue, subscribed: true)

      is_expected.to be(true)
    end
  end

  describe '#issue_path' do
    it 'returns correct path' do
      expect(presenter.issue_path).to eq("/#{group.name}/#{project.name}/-/issues/#{issue.iid}")
    end
  end
end