text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='LocalityGISSelections',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('localitylabel', models.CharField(blank=True, db_column='localitylabel', max_length=255, null=True, verbose_name='locality label')),
                ('sourcefc', models.CharField(blank=True, db_column='sourcefc', max_length=255, null=True, verbose_name='source fc')),
            ],
            options={
                'db_table': 'localitygisselections',
                'managed': True,
                'verbose_name_plural': 'Locality GIS Selections',
            },
        ),
        migrations.CreateModel(
            name='LocalityPlaceResourceEvent',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
            ],
            options={
                'db_table': 'localityplaceresourceevent',
                'managed': True,
                'verbose_name_plural': 'Localities - Place-Resources',
            },
        ),
        migrations.CreateModel(
            name='MediaCitationEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='excerpt/description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=255, null=True)),
            ],
            options={
                'db_table': 'mediacitationevents',
                'verbose_name_plural': 'Media - Sources',
                'verbose_name': 'Medium - Source',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='PlaceAltIndigenousName',
            fields=[
                ('altindigenousnameid', models.AutoField(db_column='altindigenousnameid', primary_key=True, serialize=False)),
                ('altindigenousname', models.CharField(blank=True, db_column='altindigenousname', max_length=255, null=True, verbose_name='alternate name')),
            ],
            options={
                'db_table': 'placealtindigenousname',
                'verbose_name': 'Place - Alternate Name',
                'managed': True,
                'verbose_name_plural': 'Places - Alternate Names',
            },
        ),
        migrations.CreateModel(
            name='PlaceGISSelections',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('placelabel', models.CharField(blank=True, db_column='placelabel', max_length=255, null=True, verbose_name='label')),
                ('sourcefc', models.CharField(blank=True, db_column='sourcefc', max_length=255, null=True, verbose_name='source fc')),
            ],
            options={
                'db_table': 'placegisselections',
                'managed': True,
                'verbose_name_plural': 'Place GIS Selections',
            },
        ),
        migrations.CreateModel(
            name='PlacesCitationEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='excerpt/description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=255, null=True)),
            ],
            options={
                'db_table': 'placescitationevents',
                'verbose_name_plural': 'Places - Sources',
                'verbose_name': 'Place - Source',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='PlacesMediaEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='relationship description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=50, null=True)),
            ],
            options={
                'db_table': 'placesmediaevents',
                'verbose_name_plural': 'Places - Media',
                'verbose_name': 'Place - Medium',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='PlacesResourceCitationEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='excerpt/description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=255, null=True)),
            ],
            options={
                'db_table': 'placesresourcecitationevents',
                'managed': True,
                'verbose_name_plural': 'Place-Resources - Sources',
            },
        ),
        migrations.CreateModel(
            name='PlacesResourceEvents',
            fields=[
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('placeresourceid', models.AutoField(db_column='placeresourceid', primary_key=True, serialize=False)),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='excerpt')),
                ('barterresource', models.BooleanField(db_column='barterresource', default=False, verbose_name='barter resource?')),
                ('january', models.BooleanField(db_column='january', default=False)),
                ('february', models.BooleanField(db_column='february', default=False)),
                ('march', models.BooleanField(db_column='march', default=False)),
                ('april', models.BooleanField(db_column='april', default=False)),
                ('may', models.BooleanField(db_column='may', default=False)),
                ('june', models.BooleanField(db_column='june', default=False)),
                ('july', models.BooleanField(db_column='july', default=False)),
                ('august', models.BooleanField(db_column='august', default=False)),
                ('september', models.BooleanField(db_column='september', default=False)),
                ('october', models.BooleanField(db_column='october', default=False)),
                ('november', models.BooleanField(db_column='november', default=False)),
                ('december', models.BooleanField(db_column='december', default=False)),
                ('year', models.IntegerField(blank=True, db_column='year', null=True)),
                ('islocked', models.BooleanField(db_column='islocked', default=False, verbose_name='locked?')),
            ],
            options={
                'db_table': 'placesresourceevents',
                'verbose_name': 'Place - Resource',
                'managed': True,
                'verbose_name_plural': 'Places - Resources',
            },
        ),
        migrations.CreateModel(
            name='PlacesResourceMediaEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='relationship description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=50, null=True)),
            ],
            options={
                'db_table': 'placesresourcemediaevents',
                'managed': True,
                'verbose_name_plural': 'Place-Resources - Media',
            },
        ),
        migrations.CreateModel(
            name='ResourceActivityCitationEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='excerpt/description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=255, null=True)),
            ],
            options={
                'db_table': 'resourceactivitycitationevents',
                'managed': True,
                'verbose_name_plural': 'Activity - Sources',
            },
        ),
        migrations.CreateModel(
            name='ResourceActivityMediaEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='relationship description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=50, null=True)),
            ],
            options={
                'db_table': 'resourceactivitymediaevents',
                'managed': True,
                'verbose_name_plural': 'Activity - Media',
            },
        ),
        migrations.CreateModel(
            name='ResourceAltIndigenousName',
            fields=[
                ('altindigenousnameid', models.AutoField(db_column='altindigenousnameid', primary_key=True, serialize=False)),
                ('altindigenousname', models.CharField(blank=True, db_column='altindigenousname', max_length=255, null=True, verbose_name='alt name')),
            ],
            options={
                'db_table': 'resourcealtindigenousname',
                'managed': True,
                'verbose_name_plural': 'Resource Alternative Names',
            },
        ),
        migrations.CreateModel(
            name='ResourceResourceEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='relationship description')),
            ],
            options={
                'db_table': 'resourceresourceevents',
                'managed': True,
                'verbose_name_plural': 'Resources - Resources',
            },
        ),
        migrations.CreateModel(
            name='ResourcesCitationEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='excerpt/description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=255, null=True)),
            ],
            options={
                'db_table': 'resourcescitationevents',
                'verbose_name_plural': 'Resources - Sources',
                'verbose_name': 'Resource - Source',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='ResourcesMediaEvents',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('enteredbyname', models.CharField(blank=True, db_column='enteredbyname', max_length=25, null=True, verbose_name='entered by name')),
                ('enteredbytribe', models.CharField(blank=True, db_column='enteredbytribe', max_length=100, null=True, verbose_name='entered by tribe')),
                ('enteredbytitle', models.CharField(blank=True, db_column='enteredbytitle', max_length=100, null=True, verbose_name='entered by title')),
                ('enteredbydate', models.DateTimeField(auto_now_add=True, db_column='enteredbydate', null=True, verbose_name='entered by date')),
                ('modifiedbyname', models.CharField(blank=True, db_column='modifiedbyname', max_length=25, null=True, verbose_name='modified by name')),
                ('modifiedbytitle', models.CharField(blank=True, db_column='modifiedbytitle', max_length=100, null=True, verbose_name='modified by title')),
                ('modifiedbytribe', models.CharField(blank=True, db_column='modifiedbytribe', max_length=100, null=True, verbose_name='modified by tribe')),
                ('modifiedbydate', models.DateTimeField(auto_now=True, db_column='modifiedbydate', null=True, verbose_name='modified by date')),
                ('relationshipdescription', models.CharField(blank=True, db_column='relationshipdescription', max_length=255, null=True, verbose_name='relationship description')),
                ('pages', models.CharField(blank=True, db_column='pages', max_length=50, null=True)),
            ],
            options={
                'db_table': 'resourcesmediaevents',
                'verbose_name_plural': 'Resources - Media',
                'verbose_name': 'Resource - Medium',
                'managed': True,
            },
        ),
    ]


text:
author: "Steven Enten"
date: 2014-12-30
title: LXC et Android 5 ARM64
weight: 10
categories:
  - phd
tags:
  - container engine
  - isolation
  - android
  - arm64
aliases:
  - "/page/lxc-et-android-5/"
---

## Introduction

[LXC](https://linuxcontainers.org/lxc/introduction/) (contraction de _Linux Containers_) est un logiciel permettant de gérer des conteneurs logiciels. Conrètement, LXC peut isole l'exécution de plusieurs environnements Linux sur une même machine. L'isolation est réalisée grâce à l'exploitation des modules de gestion de namespaces du Kernel Linux.

Depuis la publication d'un [article en décembre 2013 sur le blog d'un des principaux développeurs de LXC (Stéphane Graber)](https://www.stgraber.org/2013/12/23/lxc-1-0-some-more-advanced-container-usage/), la communauté d'utilisateurs de conteneurs logiciels est consciente de la possibilité d'utiliser LXC sur un appareil Android. Stéphane Graber en a fait la [démonstration à l'occasion de l'évènement Linux Plumbers Conference de septembre 2013](https://www.youtube.com/watch?v=XZWy2g9YY30).

Les gestionnaires de conteneurs boulversent progressivement les domaines de l'informatique liés à la virtualisation. Le possible usage de LXC sur Android offre des perspectives nouvelles pour l'industrie et la recherche. Un développeur a d'ailleurs démontré (durant l'évènement Droidconf de décembre 2013) le potentiel de LXC en étant capable de [changer à chaud la version d'Android avec une simple application](https://www.youtube.com/watch?v=UpIFByNLM5U).

LXC n'étant pas une application du Google Play Store, son installation sur Android n'est pas évidente. L'utilisateur qui souhaite se lancer sur cette voie est rapidement confronté à des problèmes systèmes. __Dans la sections suivantes, nous décrivons les principaux problèmes que nous avons rencontrés pour installer et utiliser LXC sur Android 5 Lollipop__.

## Contexte

Avant d'aborder les problèmes d'installation de LXC sur Android que nous avons rencontrés, il est important que le lecteur ait connaissance de notre plateforme de test.

### Matériel

Nous avons souhaité réaliser ces tests sur un appareil disposant d'une architecture ARM 64-bits (ARMv8). Ce type d'appareil n'étant pas encore démocratisé, nous avons fait le choix d'utiliser une machine virtuelle Qemu.

Pour lancer la machine virtuelle de notre appareil fictif, nous utilisons une version dérivée de Qemu. Cette version est issue de la compilation de la branche [ranchu](https://qemu-android.googlesource.com/qemu-android/+/ranchu) du projet [qemu-android](https://qemu-android.googlesource.com/qemu-android/) d'AOSP. L'avantage de cette version est son support de machines virtuelles à l'architecture ARM 64-bits.

Une fois lancé, notre appareil virtuel dispose d'un CPU cortex-a57 et de 4Go de mémoire vive. Il dispose également de 16Go de mémoire disque (en modifiant la taille de l'image `data.img`, voir section suivante).

### Système d'exploitation

Notre choix d'architecture ARM 64-bits nous impose l'utilisation de la version 5 (Lollipop) d'Android car c'est la seule version supportant ce type d'architecture.

Pour obtenir les images des systèmes de fichiers d'Android 5 utilisées pour lancer notre appareil virtuel (`ramdisk.img`, `system.img`, `userdata.img` et `cache.img`), nous avons utilisé la configuration de compilation `ranchu` de la branche [android-5.0.0_r7](https://android.googlesource.com/platform/manifest/+/refs/heads/android-5.0.0_r7) des sources du projet [Android Open Source Project](https://source.android.com/).

Pour obtenir un espace disque important dans notre appareil virtuel, nous avons redimensionné l'image du système de fichiers utilisateur (`userdata.img`).

```bash
# Augmenter la taille de l'image userdata.img d'environs 16Go
dd if=/dev/zero bs=1M count=16000 >> userdata.img
e2fsck -f userdata.img
resize2fs userdata.img
e2fsck -f userdata.img
```

### Kernel Linux

Nous utilisons une version dérivée du noyau Linux. Cette version correspond à la version 3.10 du noyau officiel. Ce noyau est précompilé dans les sources d'AOSP et est disponible dans le répertoire `prebuilts/qemu-kernel/arm64` sous le fichier `kernel-qemu`.

Un projet spécifique est consacré à ce noyau dans le dépôt des sources d'AOSP : [kernel/goldfish](https://android.googlesource.com/kernel/goldfish/). Pour recompiler ce noyau adapté à Qemu, nous avons utilisé la branche [android-goldfish-3.10](https://android.googlesource.com/kernel/goldfish/+/android-goldfish-3.10) du projet.

_Note : `goldfish` désigne les modules des périphériques virtuels nécessaires pour virtualiser Android avec Qemu. Nous vous recommandons la lecture de [GOLDFISH-VIRTUAL-HARDWARE.TXT](https://android.googlesource.com/platform/external/qemu.git/+/master/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT) pour en savoir plus._

### Configuration réseau

Pour que notre appareil fictif ait sa propre adresse IP, nous avons configuré une interface réseau virtuelle connectée à la machine host (utilisée pour les tests) via une interface bridge.

Ainsi, lorsque l'appareil virtuel Android est démarré, il suffit de lancer la directive `dhcpcd eth0` pour demander au DHCP du réseau l'attribution d'une adresse IP (grâce à l'interface bridge, le DHCP traite la requête de notre périphérique virtuel comme celle de n'importe quelle machine physique du réseau).

## Problèmes fondamentaux

### Système Unix restreint

#### Problème

Android est un système d'exploitation Linux destiné à piloter des systèmes embarqués. La philosophie d'Android a conduit ses développeurs à intégrer les outils systèmes uniquement nécessaire à son fonctionnement.

Cette optimisation du système fait d'Android une __distribution Linux "restrictive" dans le sens où les utilisateurs__, familiarisés à l'utilisation d'une des distribution Linux majeures (Debian par exemple), __ne retrouvent pas les outils nécessaires à leurs usages habituels__ (comme un gestionnaire de paquets).

#### Solution

Pour pouvoir utiliser certains utilitaires UNIX absents d'Android, il est d'usage d'__installer une version ARM de [busybox](http://busybox.net/about.html)__ (en copiant son binaire dans le répertoire `/system/bin`).

Les utilitaires fournis par `busybox` ne suffisent pas à combler les lacunes d'Android. Néanmoins ils nous ont permis d'__installer et de configurer un rootfs Archlinux__. Ainsi, nous disposons maintenant d'une distribution Archlinux embarquée dans notre appareil Android afin d'étendre son fonctionnement.

On peut alors installer facilement LXC grâce à `pacman`, le gestionnaire de paquets d'Archlinux.

### Echec des connexions HTTPS

#### Problème

Une fois le rootfs Archlinux installé et configuré, nous avons souhaité mettre à jour les paquets et installer le paquet LXC. Au cours de cette manipulation, nous avons constaté l'__impossibilité d'établir une connexion via le protocole `https`__.

#### Solution

Ce problème est lié à la date du système. En effet, la date de notre appareil virtuel une fois lancé est assignée au 1/1/1970. Pour corriger ce problème, __il suffit de mettre à jour la date du système__ (avec l'utilitaire `rdate` de `busybox` par exemple).
```bash
busybox rdate -s ntp.unice.fr
```

### Modules du Kernel manquants

#### Problème

Après avoir installé LXC avec `pacman`, et avant de lancer notre premier test de conteneur, nous avons utilisé le script [lxc-checkconfig](https://github.com/lxc/lxc/blob/master/src/lxc/lxc-checkconfig.in). Ce script lit la configuration du kernel utilisée pour sa compilation. Il vérifit la présence de certaines constantes nécessaires à la compilation des modules requis par LXC. Avec ce script, nous avons pu constater l'__absence de modules (du kernel précompilé) nécessaires au bon fonctionnement de LXC__.

#### Solution

Nous avons __recompilé le kernel__ à partir des sources du projet `kernel/goldfish`. Avant de recompiler le kernel, nous avons __modifié la configuration de compilation `ranchu_defconfig`__ (fichier uniquement présent dans le répertoire `arch/arm64/configs/` de la branche `android-goldfish-3.10`) pour y ajouter les constantes suivantes :

```bash
CONFIG_IPC_NS=y
CONFIG_PID_NS=y
CONFIG_PID_IN_CONTEXTIDR=y
CONFIG_NET_NS=y
CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
CONFIG_CGROUP_DEVICE=y
CONFIG_CGROUP_CPUACCT=y
CONFIG_CPUSETS=y
CONFIG_VETH=y
CONFIG_UTS_NS=y
CONFIG_CGROUP_FREEZER=y
CONFIG_CGROUP_PERF=y
CONFIG_RESOURCE_COUNTERS=y
CONFIG_MEMCG=y
CONFIG_MEMCG_SWAP=y
#CONFIG_USER_NS=y
CONFIG_BTRFS_FS=y
CONFIG_EXT4_FS_POSIX_ACL=y
CONFIG_EXT4_FS_SECURITY=y
CONFIG_MACVLAN=y
CONFIG_NETFILTER_XT_MATCH_ADDRTYPE=y
CONFIG_VLAN_8021Q=y
CONFIG_BLK_CGROUP=y
CONFIG_CFQ_GROUP_IOSCHED=y
```

__Important__ : La constante `CONFIG_USER_NS` est volontairement désactivée à cause d'un problème de compilation (lié à la version des sources de ce module).

### Impossibilité de lancer des binaires non-PIE

#### Problème

Au cours de nos tests, nous avons rencontré une sécurité système propre à Android 5 (branche `android-5.0.0_r7`). Ce test de sécurité __bloque l'exécution de fichiers binaires non-[PIE](http://en.wikipedia.org/wiki/Position-independent_code)__. Pour qu'un exécutable soit PIE, il faut le spécifier à sa compilation.

#### Solution

Pour outre passer cette sécurité, un [patch a été développé par un membre du forum XDA-Developers](http://forum.xda-developers.com/google-nexus-5/development/fix-bypassing-pie-security-check-t2797731). Cette solution semble fonctionner selon certains utilisateurs. Nous avons préférés __recompiler le code source en désactivant cette sécurité__. Pour cela nous avons commenter le bloc de code ci-dessous dans le fichier `bionic/linker/linker.cpp`

```cpp
2181    //if (elf_hdr->e_type != ET_DYN) {
2182    //    __libc_format_fd(2, "error: only position independent executables (PIE) are supported.\n");
2183    //    exit(EXIT_FAILURE);
2184    //}
```

### Cgroups non-montés

#### Problème

Lorsque non consultons le fichier `/proc/cgroups`, nous constatons la présence plusieurs cgroups. Or lorsque nous consultons les périphériques montés (avec la commande `mount`), nous avons constaté que seul le cgroup `memory` était monté. __La majorité des cgroups ne sont donc pas montés__.

#### Solution

Il faut __monter les cgroups manquants__. Pour cela nous nous sommes basés sur les [scripts de tianon](https://github.com/tianon/cgroupfs-mount/) à la différence que nous montons les cgroups dans la racine de notre rootfs Archlinux (étant donné que nous utilisons LXC à travers ce rootfs).

```bash
for i in $(busybox awk '!/^#/ { if ($4 == 1) print $1 }' /proc/cgroups); do
    if ! grep -q " $ROOTFS/$i " /proc/mounts; then
        mkdir -p $ROOTFS/$i
        /system/bin/busybox mount -n -t cgroup -o $i cgroup $ROOTFS/$i
    fi
done
```

__Important__ : si l'arborescence des cgroups n'est pas montée dans le rootfs, il ne sera pas possible de lancer plus d'un conteneur à la fois.

### Echec d'utilisation des cgroups dans un rootfs

#### Problème

Bien que les cgroups soient montés, ceux-ci sont __inutilisables à cause d'un problème d'autorisation d'écriture__ semble-t-il. N'ayant aucune expérience en matière d'utilisation des modules de gestion des namespaces, nous ne savions pas comment corriger ce problème. Néanmoins, nous étions persuadés que le problème était propre à Android (et probablement au fait qu'on utilise LXC à travers un rootfs).

#### Solution

Pour tenter de résoudre ce problème, nous avons analysés les [fichiers utilisés par S. Graber](https://web.archive.org/web/20140723085319/https://qa.linuxcontainers.org/master/current/android-armel/lxc-android.tar.gz) dans sa démonstration de décembre 2013. Nous avons constaté qu'il utilisait un programme appellé `sbin` pour remonter recursivement la racine du téléphone `/` en mode privé.

__En remontant la racine de notre appareil virtuel en mode privé (avec le programme `sbin`) et en démarrant le programme [cgmanager](https://linuxcontainers.org/fr/cgmanager/introduction/) dans notre rootfs Archlinux, nous avons pu lancer notre premier conteneur LXC sur Android.__

_Note : le programme `sbin` récupérée dans l'archive de S. Graber est non-PIE. Il est inutilisable si le programme `linker` d'Android 5 n'est pas patché (comme expliqué précédemment)._

### Conteneur sans accès réseau

#### Problème

Par défaut, la configuration réseau d'un conteneur est vide. Sans configuration réseau, __le conteneur ne dispose pas d'interface pour être connecté en réseau (pas d'adresse IP)__. La configuration réseau "vide" est indiquée dans le fichier de configuration d'un conteneur par la ligne suivante :

```
# Network configuration
lxc.network.type = empty
```

#### Solution

Parmis les différents types de configuration réseau supportés par LXC, __le type `macvlan` et son mode `bridge` nous ont permis d'obtenir une IP propre pour nos conteneurs__. Nous vous recommandons la lecture de cet [excellent article du blog containerops.org](http://containerops.org/2013/11/19/lxc-networking/) pour en savoir plus sur les différents types de configuration réseau de LXC.

```
# Network configuration
lxc.network.type = macvlan
lxc.network.macvlan.mode = bridge
lxc.network.flags = up
lxc.network.link = eth0
```

__Attention__ ! Souvenez-vous que l'utilisation d'un type de configuration réseau dépend des modules du kernel et du matériel sur lequel il est installé (par exemple l'option `CONFIG_MACVLAN=y` utilisée pour recompiler le kernel est nécessaire pour utiliser le type de configuration `macvlan` de LXC).

## Démonstration

_Cliquer sur l'image pour voir la vidéo._

[![LXC on Android - Test 1](http://img.youtube.com/vi/1rW_lFyVY_w/0.jpg)](http://www.youtube.com/watch?v=1rW_lFyVY_w)

## Conclusion

L'installation de LXC sur Android requiert différentes maniputions du système. Afin de capitaliser les bonnes pratiques pour utiliser LXC sur Android, nous avons développé le script [alfred](https://gist.github.com/enten/63cedaca9bf019feb71a). Cet outil est utilisé dans notre vidéo de démonstration.

redpajama_set_name: RedPajamaGithub


text:
<?xml version="1.0" encoding="UTF-8" standalone="no"?><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>

    <parent>
        <groupId>uk.theretiredprogrammer</groupId>
        <artifactId>nbm-pom</artifactId>
        <version>3.0.0-SNAPSHOT</version>
    </parent>

    <groupId>uk.theretiredprogrammer.hockeytracker</groupId>
    <artifactId>branding</artifactId>
    <version>2.0.0-SNAPSHOT</version>
    <packaging>nbm</packaging>

    <name>Hockey Tracker - Branding</name>

    <url>https://www.theretiredprogrammer.uk/?Project=${projectId}</url>

    <scm>
        <connection>scm:git:git://github.com/The-Retired-Programmer/${projectId}.git</connection>
        <developerConnection>scm:git:ssh://github.com:The-Retired-Programmer/${projectId}.git</developerConnection>
        <url>http://github.com/The-Retired-Programmer/${projectId}/tree/master</url>
    </scm>

    <developers>
        <developer>
            <name>Richard Linsdale</name>
            <email>richard@theretiredprogrammer.uk</email>
            <organization>The-Retired-Programmer</organization>
            <organizationUrl>https://www.theretiredprogrammer.uk</organizationUrl>
        </developer>
    </developers>

    <licenses>
        <license>
            <name>The Apache License, Version 2.0</name>
            <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
        </license>
    </licenses>

    <properties>
        <projectId>hockeytracker</projectId>
        <nbm.license.file>../LICENSE</nbm.license.file>
        <nbm.license.name>The Apache License, Version 2.0</nbm.license.name>
        <netbeans.version>RELEASE82</netbeans.version>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <description>Description 9-8-7 branding</description>
</project>


text:
@implementation FLObjcMethodName : FLObjcName
+ (id) objcMethodName:(NSString*) methodName {
    return FLAutorelease([[[self class] alloc] initWithIdentifierName:methodName
                                                               prefix:nil
                                                               suffix:nil]);
}

- (NSString*) generatedName {
    return [[super generatedName] stringWithLowercaseFirstLetter_fl];
}

@end


text:
@interface ToolbarController : NSToolbar {

  @private
  IBOutlet NSArrayController *usedXpaths;

  IBOutlet NSView *generalView;
  IBOutlet NSView *siteView;
  IBOutlet NSView *advancedView;
  IBOutlet NSToolbarItem *firstClickButton;

  IBOutlet NSWindow *mainWindow;
  IBOutlet NSView  *mainContentView;

  NSView *currentPreferencesView;
  NSArray *identifiers;

  NSUInteger lastNumberOfXpathViews;
}

- (IBAction)generalClick:(id)sender;
- (IBAction)siteClick:(id)sender;
- (IBAction)advancedClick:(id)sender;

- (void)xPathsChanged:(NSNotification *)note;
- (void)switchToWiew:(NSView *)newView;

@end


text:
This example application uses:

- [django-websocket-request](https://github.com/GetBlimp/django-websocket-request)
- [Django](https://www.djangoproject.com)
- [Django REST framework](http://django-rest-framework.org)
- [SockJS](http://sockjs.org)
- [Tornado](https://github.com/mrjoes/sockjs-tornado/)

## Live demo

This example application is running on Heroku.

[http://dwr-example.herokuapp.com/](http://dwr-example.herokuapp.com/)

Note that Django is not running at all. Tornado is serving a static HTML file and is routing the websocket requests. django-websocket-request then does the magic.

Throttling is enabled and snippets are erased periodically. If you run into any errors feel free to bother [@jpadilla_](https://twitter.com/jpadilla_) on Twitter about it.

## Running locally

``` bash
$ pip install -r requirements.txt
$ python manage.py syncdb
$ python ws.py
$ open http://127.0.0.1:8080
```


text:
<?php

namespace Google\Service\Dns;

class ResponsePolicyRulesListResponse extends \Google\Collection
{
  protected $collection_key = 'responsePolicyRules';
  protected $headerType = ResponseHeader::class;
  protected $headerDataType = '';
  /**
   * @var string
   */
  public $nextPageToken;
  protected $responsePolicyRulesType = ResponsePolicyRule::class;
  protected $responsePolicyRulesDataType = 'array';

  /**
   * @param ResponseHeader
   */
  public function setHeader(ResponseHeader $header)
  {
    $this->header = $header;
  }
  /**
   * @return ResponseHeader
   */
  public function getHeader()
  {
    return $this->header;
  }
  /**
   * @param string
   */
  public function setNextPageToken($nextPageToken)
  {
    $this->nextPageToken = $nextPageToken;
  }
  /**
   * @return string
   */
  public function getNextPageToken()
  {
    return $this->nextPageToken;
  }
  /**
   * @param ResponsePolicyRule[]
   */
  public function setResponsePolicyRules($responsePolicyRules)
  {
    $this->responsePolicyRules = $responsePolicyRules;
  }
  /**
   * @return ResponsePolicyRule[]
   */
  public function getResponsePolicyRules()
  {
    return $this->responsePolicyRules;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ResponsePolicyRulesListResponse::class, 'Google_Service_Dns_ResponsePolicyRulesListResponse');


text:
package com.lzh.router.replugin.host;

import android.app.ActivityManager;
import android.content.Context;
import android.os.Process;

import com.lzh.nonview.router.RouterConfiguration;
import com.lzh.nonview.router.route.RouteCallback;
import com.lzh.router.replugin.core.IPluginCallback;
import com.lzh.router.replugin.core.IUriConverter;
import com.lzh.router.replugin.core.RePluginRouteCallback;
import com.lzh.router.replugin.core.RouterResumeReceiver;

import java.util.List;

/**
 * 宿主配置入口
 * Created by haoge on 2017/8/24.
 */
@SuppressWarnings("unused")
public final class HostRouterConfiguration {

    /**
     * 初始化加载。此方法每个插件只需要被加载一次。请尽早进行初始化。
     * @param hostPackage 宿主包名:用于指定启动、连接远程路由服务。为各插件提供路由索引功能
     * @param context 用于启动远程任务的。
     */
    public static void init(String hostPackage, Context context) {
        if (!inMainProcess(context)) {
            // 当为host时,此时会被多个子进程触发,在此只允许主进程的初始化操作
            return;
        }

        // 启动并连接远程路由服务。
        RouterConfiguration.get().startHostService(hostPackage, context);
        // 初始化callback.
        RouterConfiguration.get().setRemoteFactory(new HostRemoteFactory());
        RouterConfiguration.get().setCallback(RePluginRouteCallback.get());
        // 设置路由启动器
        RouterConfiguration.get().setActionLauncher(HostActionLauncher.class);
        RouterConfiguration.get().setActivityLauncher(HostActivityLauncher.class);

        RouterResumeReceiver.registerSelf(context, null, true);
    }

    public HostRouterConfiguration setCallback(IPluginCallback callback) {
        RePluginRouteCallback.get().setCallback(callback);
        return this;
    }

    public HostRouterConfiguration setRouteCallback(RouteCallback callback) {
        RePluginRouteCallback.get().setRouteCallback(callback);
        return this;
    }

    /**
     * 设置路由uri转换器。
     *
     * @see IUriConverter
     * @param converter non-null.
     * @return configuration
     */
    public HostRouterConfiguration setConverter(IUriConverter converter) {
        if (converter != null) {
            RePluginRouteCallback.get().setConverter(converter);
        }
        return this;
    }

    private static HostRouterConfiguration configuration = new HostRouterConfiguration();
    private HostRouterConfiguration() {}
    public static HostRouterConfiguration get() {
        return configuration;
    }

    private static boolean inMainProcess(Context context) {
        int mPid = Process.myPid();
        String packageName = context.getPackageName();
        ActivityManager manager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
        List<ActivityManager.RunningAppProcessInfo> processes =
                manager.getRunningAppProcesses();
        for (ActivityManager.RunningAppProcessInfo info : processes) {
            if (mPid != info.pid) {
                continue;
            }

            return packageName.equals(info.processName);
        }
        return false;
    }

}


text:
package v1

import (
	context "context"
	fmt "fmt"
	v1 "github.com/census-instrumentation/opencensus-proto/gen-go/agent/common/v1"
	v11 "github.com/census-instrumentation/opencensus-proto/gen-go/metrics/v1"
	v12 "github.com/census-instrumentation/opencensus-proto/gen-go/resource/v1"
	proto "github.com/golang/protobuf/proto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package

type ExportMetricsServiceRequest struct {
	// This is required only in the first message on the stream or if the
	// previous sent ExportMetricsServiceRequest message has a different Node (e.g.
	// when the same RPC is used to send Metrics from multiple Applications).
	Node *v1.Node `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
	// A list of metrics that belong to the last received Node.
	Metrics []*v11.Metric `protobuf:"bytes,2,rep,name=metrics,proto3" json:"metrics,omitempty"`
	// The resource for the metrics in this message that do not have an explicit
	// resource set.
	// If unset, the most recently set resource in the RPC stream applies. It is
	// valid to never be set within a stream, e.g. when no resource info is known
	// at all or when all sent metrics have an explicit resource set.
	Resource             *v12.Resource `protobuf:"bytes,3,opt,name=resource,proto3" json:"resource,omitempty"`
	XXX_NoUnkeyedLiteral struct{}      `json:"-"`
	XXX_unrecognized     []byte        `json:"-"`
	XXX_sizecache        int32         `json:"-"`
}

func (m *ExportMetricsServiceRequest) Reset()         { *m = ExportMetricsServiceRequest{} }
func (m *ExportMetricsServiceRequest) String() string { return proto.CompactTextString(m) }
func (*ExportMetricsServiceRequest) ProtoMessage()    {}
func (*ExportMetricsServiceRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_47e253a956287d04, []int{0}
}

func (m *ExportMetricsServiceRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ExportMetricsServiceRequest.Unmarshal(m, b)
}
func (m *ExportMetricsServiceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ExportMetricsServiceRequest.Marshal(b, m, deterministic)
}
func (m *ExportMetricsServiceRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ExportMetricsServiceRequest.Merge(m, src)
}
func (m *ExportMetricsServiceRequest) XXX_Size() int {
	return xxx_messageInfo_ExportMetricsServiceRequest.Size(m)
}
func (m *ExportMetricsServiceRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_ExportMetricsServiceRequest.DiscardUnknown(m)
}

var xxx_messageInfo_ExportMetricsServiceRequest proto.InternalMessageInfo

func (m *ExportMetricsServiceRequest) GetNode() *v1.Node {
	if m != nil {
		return m.Node
	}
	return nil
}

func (m *ExportMetricsServiceRequest) GetMetrics() []*v11.Metric {
	if m != nil {
		return m.Metrics
	}
	return nil
}

func (m *ExportMetricsServiceRequest) GetResource() *v12.Resource {
	if m != nil {
		return m.Resource
	}
	return nil
}

type ExportMetricsServiceResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *ExportMetricsServiceResponse) Reset()         { *m = ExportMetricsServiceResponse{} }
func (m *ExportMetricsServiceResponse) String() string { return proto.CompactTextString(m) }
func (*ExportMetricsServiceResponse) ProtoMessage()    {}
func (*ExportMetricsServiceResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_47e253a956287d04, []int{1}
}

func (m *ExportMetricsServiceResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_ExportMetricsServiceResponse.Unmarshal(m, b)
}
func (m *ExportMetricsServiceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_ExportMetricsServiceResponse.Marshal(b, m, deterministic)
}
func (m *ExportMetricsServiceResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_ExportMetricsServiceResponse.Merge(m, src)
}
func (m *ExportMetricsServiceResponse) XXX_Size() int {
	return xxx_messageInfo_ExportMetricsServiceResponse.Size(m)
}
func (m *ExportMetricsServiceResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_ExportMetricsServiceResponse.DiscardUnknown(m)
}

var xxx_messageInfo_ExportMetricsServiceResponse proto.InternalMessageInfo

func init() {
	proto.RegisterType((*ExportMetricsServiceRequest)(nil), "opencensus.proto.agent.metrics.v1.ExportMetricsServiceRequest")
	proto.RegisterType((*ExportMetricsServiceResponse)(nil), "opencensus.proto.agent.metrics.v1.ExportMetricsServiceResponse")
}

func init() {
	proto.RegisterFile("opencensus/proto/agent/metrics/v1/metrics_service.proto", fileDescriptor_47e253a956287d04)
}

var fileDescriptor_47e253a956287d04 = []byte{
	// 361 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x41, 0x4a, 0xc3, 0x40,
	0x14, 0x86, 0x9d, 0x56, 0xaa, 0x4c, 0xc1, 0x45, 0xdc, 0x94, 0x2a, 0xd2, 0x56, 0x91, 0x8a, 0x64,
	0x62, 0xea, 0x42, 0x10, 0x54, 0xac, 0xb8, 0x11, 0xd4, 0x12, 0xc1, 0x85, 0x1b, 0x69, 0xd3, 0x47,
	0xcc, 0x22, 0x33, 0x71, 0x66, 0x12, 0xbc, 0x85, 0x77, 0x70, 0xef, 0x8d, 0x3c, 0x81, 0xa7, 0x90,
	0xe4, 0x4d, 0x5a, 0x4a, 0x8c, 0x05, 0x77, 0x8f, 0xe4, 0xff, 0xfe, 0xf7, 0xff, 0x33, 0x43, 0x4f,
	0x44, 0x0c, 0xdc, 0x07, 0xae, 0x12, 0xe5, 0xc4, 0x52, 0x68, 0xe1, 0x8c, 0x03, 0xe0, 0xda, 0x89,
	0x40, 0xcb, 0xd0, 0x57, 0x4e, 0xea, 0x16, 0xe3, 0xb3, 0x02, 0x99, 0x86, 0x3e, 0xb0, 0x5c, 0x66,
	0x75, 0xe7, 0x20, 0x7e, 0x61, 0x39, 0xc8, 0x8c, 0x9a, 0xa5, 0x6e, 0xdb, 0xae, 0xf0, 0xf6, 0x45,
	0x14, 0x09, 0x9e, 0x59, 0xe3, 0x84, 0x7c, 0xfb, 0xa0, 0x24, 0x2f, 0x87, 0x30, 0xd2, 0xc3, 0x92,
	0x54, 0x82, 0x12, 0x89, 0xf4, 0x21, 0xd3, 0x16, 0x33, 0x8a, 0x7b, 0x5f, 0x84, 0x6e, 0x5d, 0xbf,
	0xc5, 0x42, 0xea, 0x5b, 0x34, 0x79, 0xc0, 0x22, 0x1e, 0xbc, 0x26, 0xa0, 0xb4, 0x75, 0x4a, 0x57,
	0xb9, 0x98, 0x42, 0x8b, 0x74, 0x48, 0xbf, 0x39, 0xd8, 0x67, 0x15, 0xc5, 0x4c, 0xd6, 0xd4, 0x65,
	0x77, 0x62, 0x0a, 0x5e, 0xce, 0x58, 0x67, 0x74, 0xcd, 0x24, 0x6b, 0xd5, 0x3a, 0xf5, 0x7e, 0x73,
	0xb0, 0x5b, 0xc6, 0xe7, 0x27, 0xc2, 0x30, 0x80, 0x57, 0x30, 0xd6, 0x90, 0xae, 0x17, 0x61, 0x5b,
	0xf5, 0xaa, 0xf5, 0xb3, 0x3a, 0xa9, 0xcb, 0x3c, 0x33, 0x7b, 0x33, 0xae, 0xb7, 0x43, 0xb7, 0x7f,
	0x6f, 0xa7, 0x62, 0xc1, 0x15, 0x0c, 0x3e, 0x08, 0xdd, 0x58, 0xfc, 0x65, 0xbd, 0x13, 0xda, 0x40,
	0xc6, 0x3a, 0x67, 0x4b, 0xef, 0x91, 0xfd, 0x71, 0x78, 0xed, 0x8b, 0x7f, 0xf3, 0x18, 0xaf, 0xb7,
	0xd2, 0x27, 0x47, 0x64, 0xf8, 0x49, 0xe8, 0x5e, 0x28, 0x96, 0x7b, 0x0d, 0x37, 0x17, 0x6d, 0x46,
	0x99, 0x6a, 0x44, 0x9e, 0x6e, 0x82, 0x50, 0xbf, 0x24, 0x93, 0xec, 0x92, 0x1c, 0x34, 0xb0, 0x43,
	0xae, 0xb4, 0x4c, 0x22, 0xe0, 0x7a, 0xac, 0x43, 0xc1, 0x9d, 0xb9, 0xb7, 0x8d, 0x4f, 0x26, 0x00,
	0x6e, 0x07, 0xe5, 0xf7, 0xfe, 0x5d, 0xeb, 0xde, 0xc7, 0xc0, 0xaf, 0x30, 0x46, 0xbe, 0x80, 0x5d,
	0xe6, 0x31, 0xcc, 0x6a, 0xf6, 0xe8, 0x4e, 0x1a, 0xb9, 0xc5, 0xf1, 0x4f, 0x00, 0x00, 0x00, 0xff,
	0xff, 0x19, 0x28, 0xa4, 0x50, 0x3f, 0x03, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
const _ = grpc.SupportPackageIsVersion4

// MetricsServiceClient is the client API for MetricsService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type MetricsServiceClient interface {
	// For performance reasons, it is recommended to keep this RPC
	// alive for the entire life of the application.
	Export(ctx context.Context, opts ...grpc.CallOption) (MetricsService_ExportClient, error)
}

type metricsServiceClient struct {
	cc *grpc.ClientConn
}

func NewMetricsServiceClient(cc *grpc.ClientConn) MetricsServiceClient {
	return &metricsServiceClient{cc}
}

func (c *metricsServiceClient) Export(ctx context.Context, opts ...grpc.CallOption) (MetricsService_ExportClient, error) {
	stream, err := c.cc.NewStream(ctx, &_MetricsService_serviceDesc.Streams[0], "/opencensus.proto.agent.metrics.v1.MetricsService/Export", opts...)
	if err != nil {
		return nil, err
	}
	x := &metricsServiceExportClient{stream}
	return x, nil
}

type MetricsService_ExportClient interface {
	Send(*ExportMetricsServiceRequest) error
	Recv() (*ExportMetricsServiceResponse, error)
	grpc.ClientStream
}

type metricsServiceExportClient struct {
	grpc.ClientStream
}

func (x *metricsServiceExportClient) Send(m *ExportMetricsServiceRequest) error {
	return x.ClientStream.SendMsg(m)
}

func (x *metricsServiceExportClient) Recv() (*ExportMetricsServiceResponse, error) {
	m := new(ExportMetricsServiceResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// MetricsServiceServer is the server API for MetricsService service.
type MetricsServiceServer interface {
	// For performance reasons, it is recommended to keep this RPC
	// alive for the entire life of the application.
	Export(MetricsService_ExportServer) error
}

// UnimplementedMetricsServiceServer can be embedded to have forward compatible implementations.
type UnimplementedMetricsServiceServer struct {
}

func (*UnimplementedMetricsServiceServer) Export(srv MetricsService_ExportServer) error {
	return status.Errorf(codes.Unimplemented, "method Export not implemented")
}

func RegisterMetricsServiceServer(s *grpc.Server, srv MetricsServiceServer) {
	s.RegisterService(&_MetricsService_serviceDesc, srv)
}

func _MetricsService_Export_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(MetricsServiceServer).Export(&metricsServiceExportServer{stream})
}

type MetricsService_ExportServer interface {
	Send(*ExportMetricsServiceResponse) error
	Recv() (*ExportMetricsServiceRequest, error)
	grpc.ServerStream
}

type metricsServiceExportServer struct {
	grpc.ServerStream
}

func (x *metricsServiceExportServer) Send(m *ExportMetricsServiceResponse) error {
	return x.ServerStream.SendMsg(m)
}

func (x *metricsServiceExportServer) Recv() (*ExportMetricsServiceRequest, error) {
	m := new(ExportMetricsServiceRequest)
	if err := x.ServerStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

var _MetricsService_serviceDesc = grpc.ServiceDesc{
	ServiceName: "opencensus.proto.agent.metrics.v1.MetricsService",
	HandlerType: (*MetricsServiceServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Export",
			Handler:       _MetricsService_Export_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
	},
	Metadata: "opencensus/proto/agent/metrics/v1/metrics_service.proto",
}


text:
set -euo pipefail
shopt -s extglob

DEBUG=${DEBUG:-''}

function run() {
  function echo_debug() {
    [[ -z "${DEBUG}" ]] && return
    echo -ne $(tput setaf 3) >&2
    echo "$1" >&2
    echo -ne $(tput sgr0) >&2
  }
  export -f echo_debug

  INSTALL_ORG_REPO=${INSTALL_ORG_REPO:-'thoughtworks/talisman'}
  SCRIPT_BASE="https://raw.githubusercontent.com/${INSTALL_ORG_REPO}/master/global_install_scripts"

  TEMP_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'talisman_uninstall')
  trap "rm -r ${TEMP_DIR}" EXIT
  chmod 0700 ${TEMP_DIR}

  ADD_AN_IGNORE_SCRIPT=${TEMP_DIR}/add_to_talismanignore_in_git_repo.bash

  function get_dependent_scripts() {
    echo_debug "getting ${SCRIPT_BASE}/add_to_talismanignore_in_git_repo.bash via curl"
    curl --silent "${SCRIPT_BASE}/add_to_talismanignore_in_git_repo.bash" >${ADD_AN_IGNORE_SCRIPT}
    chmod +x ${ADD_AN_IGNORE_SCRIPT}
  }

  get_dependent_scripts

  echo "Adding pattern to .talismanignore recursively in git repos"
  read -p "Please enter pattern to add to .talismanignore (enter to abort): " IGNORE_PATTERN
  [[ -n $IGNORE_PATTERN ]] || exit 1

  read -e -p "Please enter root directory to search for git repos (Default: ${HOME}): " SEARCH_ROOT
  SEARCH_ROOT=${SEARCH_ROOT:-$HOME}
  SEARCH_CMD="find"
  EXTRA_SEARCH_OPTS=""
  echo -e "\tSearching ${SEARCH_ROOT} for git repositories"

  SUDO_PREFIX=""
  if [[ "${SEARCH_ROOT}" == "/" ]]; then
    echo -e "\tPlease enter your password when prompted to enable script to search as root user:"
    SUDO_PREFIX="sudo"
    EXTRA_SEARCH_OPTS="-xdev \( -path '/private/var' -prune \) -o"
  fi

  CMD_STRING="${SUDO_PREFIX} ${SEARCH_CMD} ${SEARCH_ROOT} ${EXTRA_SEARCH_OPTS} -name .git -type d -exec ${ADD_AN_IGNORE_SCRIPT} {} ${IGNORE_PATTERN} \;"
  echo_debug "EXECUTING: ${CMD_STRING}"
  eval "${CMD_STRING}"
}

run $0 $@


text:
using UnityEngine;
using System.Collections;
using UnityEditor;
using UnityEngine.UI.Windows.Plugins.Social;
using UnityEngine.UI.Windows.Plugins.Social.Core;
using UnityEngine.UI.Windows.Plugins.Flow;
using FD = UnityEngine.UI.Windows.Plugins.Flow.Data;

namespace UnityEditor.UI.Windows.Plugins.Social {

	[CustomEditor(typeof(SocialSettings))]
	public class SocialSettingsEditor : Editor {

		private static ModuleSettings[] socials;

		public void OnEnable() {

			var dataPath = AssetDatabase.GetAssetPath(this.target);
			var directory = System.IO.Path.GetDirectoryName(dataPath);

			// Scan for the installed socials
			SocialSettingsEditor.socials = ME.EditorUtilities.GetAssetsOfType<ModuleSettings>(directory, useCache: false);

		}

		public override void OnInspectorGUI() {

			var target = this.target as SocialSettings;
			var socials = SocialSettingsEditor.socials;

			target.uniqueTag = (FD.FlowWindow.Flags)EditorGUILayout.EnumPopup("Unique Tag:", target.uniqueTag);

			GUILayout.Label("Platforms", EditorStyles.boldLabel);

			if (target.activePlatforms == null) target.activePlatforms = new Platform[0];

			if (target.activePlatforms.Length != socials.Length) {

				System.Array.Resize(ref target.activePlatforms, socials.Length);

				EditorUtility.SetDirty(target);

			}

			for (int i = 0; i < target.activePlatforms.Length; ++i) {

				var sourcePlatform = socials[i];

				if (target.activePlatforms[i] == null) {

					target.activePlatforms[i] = new Platform();
					target.activePlatforms[i].active = true;
					target.activePlatforms[i].settings = sourcePlatform;

				}

				var platform = target.activePlatforms[i];
				EditorGUILayout.BeginVertical(EditorStyles.helpBox);
				{
					platform.active = EditorGUILayout.ToggleLeft(sourcePlatform.GetPlatformName(), platform.active, EditorStyles.boldLabel);
					var oldState = GUI.enabled;
					GUI.enabled = platform.active;
					platform.settings = EditorGUILayout.ObjectField(platform.settings, typeof(ModuleSettings), false) as ModuleSettings;
					GUI.enabled = oldState;
				}
				EditorGUILayout.EndVertical();

			}

		}

	}

}


text:
using Elastic.Clients.Elasticsearch.Fluent;
using Elastic.Clients.Elasticsearch.Serialization;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Text.Json;
using System.Text.Json.Serialization;

#nullable restore
namespace Elastic.Clients.Elasticsearch.IndexManagement;
public sealed partial class IndexTemplateDataStreamConfiguration
{
	[JsonInclude]
	[JsonPropertyName("allow_custom_routing")]
	public bool? AllowCustomRouting { get; init; }

	[JsonInclude]
	[JsonPropertyName("hidden")]
	public bool? Hidden { get; init; }
}


text:
user=$(whoami);
if [ "$user" != "root" ]; then
	echo "this script must run as root"
else
	echo "configuring nginx"
	node ./bin/nginx.js > /etc/nginx/sites-enabled/default
	nginxpid=`cat /run/nginx.pid`
	echo "performing graceful restart"
	kill -HUP "$nginxpid"
	echo "checking config"
	nginx -t
fi


text:
package org.spongepowered.common.mixin.core.tileentity;

import com.flowpowered.math.vector.Vector3d;
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityList;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.tileentity.MobSpawnerBaseLogic;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.world.chunk.storage.AnvilChunkLoader;
import org.apache.logging.log4j.Level;
import org.spongepowered.api.entity.EntityType;
import org.spongepowered.api.entity.Transform;
import org.spongepowered.api.event.SpongeEventFactory;
import org.spongepowered.api.event.cause.Cause;
import org.spongepowered.api.event.cause.NamedCause;
import org.spongepowered.api.event.cause.entity.spawn.SpawnCause;
import org.spongepowered.api.event.cause.entity.spawn.SpawnTypes;
import org.spongepowered.api.event.entity.ConstructEntityEvent;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import org.spongepowered.asm.util.PrettyPrinter;
import org.spongepowered.common.SpongeImpl;
import org.spongepowered.common.SpongeImplHooks;
import org.spongepowered.common.data.util.NbtDataUtil;
import org.spongepowered.common.event.tracking.CauseTracker;
import org.spongepowered.common.registry.type.entity.EntityTypeRegistryModule;

@Mixin(MobSpawnerBaseLogic.class)
public abstract class MixinMobSpawnerBaseLogic {

    private static final String
            ANVIL_CHUNK_LOADER_READ_ENTITY =
            "Lnet/minecraft/world/chunk/storage/AnvilChunkLoader;readWorldEntityPos(Lnet/minecraft/nbt/NBTTagCompound;Lnet/minecraft/world/World;DDDZ)Lnet/minecraft/entity/Entity;";

    @Shadow private int spawnRange;

    @Shadow public abstract BlockPos getSpawnerPosition();
    @Shadow public abstract World getSpawnerWorld();

    /**
     * @author gabizou - January 30th, 2016
     * @author gabizou - Updated April 10th, 2016 - Update for 1.9 since it's passed to the AnvilChunkLoader
     *
     * Redirects to throw a ConstructEntityEvent.PRE
     * @param world
     * @return
     */
    @Redirect(method = "updateSpawner", at = @At(value = "INVOKE", target = ANVIL_CHUNK_LOADER_READ_ENTITY))
    private Entity onConstruct(NBTTagCompound compound, World world, double x, double y, double z, boolean doesNotForceSpawn) {
        return readEntityFromCompoundAtWorld(compound, world, x, y, z, doesNotForceSpawn);

    }

    /**
     * @author gabizou - April 10th, 2016
     *
     * This is close to a verbatim copy of {@link AnvilChunkLoader#readWorldEntityPos(NBTTagCompound, World, double, double, double, boolean)}
     * with the added bonus of throwing events before entities are constructed with appropriate causes.
     *
     * @param compound The compound of the entity to spawn with
     * @param world The world to spawn at
     * @param x The x position
     * @param y The y position
     * @param z The z position
     * @param attemptToSpawn If false, the entity is not going to be spawned into the world yet
     * @return The entity, if successfully created
     */
    private static Entity readEntityFromCompoundAtWorld(NBTTagCompound compound, World world, double x, double y, double z, boolean attemptToSpawn) {
        final String entityTypeString = compound.getString(NbtDataUtil.ENTITY_TYPE_ID);
        final Class<? extends Entity> clazz = SpongeImplHooks.getEntityClass(new ResourceLocation(entityTypeString));
        if (clazz == null) {
            final PrettyPrinter printer = new PrettyPrinter(60).add("Unknown Entity for MobSpawners").centre().hr()
                .addWrapped(60, "Sponge has found a MobSpawner attempting to locate potentially"
                                + "a foreign entity type for a MobSpawner, unfortunately, there isn't a"
                                + "way to get around the deserialization process looking up unregistered"
                                + "entity types. This may be a bug with a mod or sponge.")
                .add("%s : %s", "Entity Name", entityTypeString)
                .add();
            CauseTracker.getInstance().generateVersionInfo(printer);
            printer.trace(System.err, SpongeImpl.getLogger(), Level.WARN);
            return null;
        }
        EntityType type = EntityTypeRegistryModule.getInstance().getForClass(clazz);
        if (type == null) {
            return null;
        }

        SpawnCause cause = SpawnCause.builder().type(SpawnTypes.MOB_SPAWNER).build(); // We can't use MobspawnerSpawnCause yet.
        Transform<org.spongepowered.api.world.World> transform = new Transform<>(
                ((org.spongepowered.api.world.World) world), new Vector3d(x, y, z));
        ConstructEntityEvent.Pre event = SpongeEventFactory.createConstructEntityEventPre(Cause.of(NamedCause.source(cause)), type, transform);
        SpongeImpl.postEvent(event);
        if (event.isCancelled()) {
            return null;
        }
        Entity entity;
        try {
            entity = EntityList.createEntityFromNBT(compound, world);
        } catch (Exception e) {
            return null;
        }

        if (entity == null) {
            return null;
        }

        entity.setLocationAndAngles(x, y, z, entity.rotationYaw, entity.rotationPitch);

        if (attemptToSpawn && !world.spawnEntity(entity)) {
            return null;
        }

        if (compound.hasKey(NbtDataUtil.Minecraft.PASSENGERS, NbtDataUtil.TAG_LIST)) {
            final NBTTagList passengerList = compound.getTagList(NbtDataUtil.Minecraft.PASSENGERS, NbtDataUtil.TAG_COMPOUND);

            for (int i = 0; i < passengerList.tagCount(); i++) {
                final Entity passenger = readEntityFromCompoundAtWorld(passengerList.getCompoundTagAt(i), world, x, y, z, attemptToSpawn);
                if (passenger != null) {
                    passenger.startRiding(entity, true);
                }
            }
        }
        return entity;
    }

}


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>

    <parent>
        <groupId>com.xeiam.xchange</groupId>
        <artifactId>xchange-parent</artifactId>
        <version>4.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>xchange-coinbaseex</artifactId>

    <name>XChange Coinbase (Exchange)</name>
    <description>XChange implementation for Coinbase (Exchange)</description>

    <url>http://xeiam.com</url>
    <inceptionYear>2012</inceptionYear>

    <organization>
        <name>Xeiam, LLC</name>
        <url>http://xeiam.com</url>
    </organization>

    <!-- Parent provides default configuration for dependencies -->
    <dependencies>

        <dependency>
            <groupId>com.xeiam.xchange</groupId>
            <artifactId>xchange-core</artifactId>
            <version>4.0.0-SNAPSHOT</version>
        </dependency>

    </dependencies>

</project>


text:
var echarts = require("../echarts");

var zrUtil = require("zrender/lib/core/util");

require("../coord/cartesian/Grid");

require("./bar/PictorialBarSeries");

require("./bar/PictorialBarView");

var barLayoutGrid = require("../layout/barGrid");

var visualSymbol = require("../visual/symbol");

require("../component/gridSimple");

// In case developer forget to include grid component
echarts.registerLayout(zrUtil.curry(barLayoutGrid, 'pictorialBar'));
echarts.registerVisual(zrUtil.curry(visualSymbol, 'pictorialBar', 'roundRect', null));


text:
require "spec_helper"

describe Mongoid::Serialization do

  before do
    Person.delete_all
  end

  describe "#serializable_hash" do

    let(:person) do
      Person.new
    end

    context "when a model has defined fields" do

      let(:attributes) do
        { 'title' => "President", 'security_code' => '1234' }
      end

      before do
        person.write_attributes attributes, false
      end

      it "serializes assigned attributes" do
        person.serializable_hash.should include attributes
      end

      it "includes all defined fields except _type" do
        field_names = person.fields.keys.map(&:to_s) - ['_type']
        person.serializable_hash.keys.should include(*field_names)
      end

      it "does not include _type" do
        person.serializable_hash.keys.should_not include '_type'
      end

      it "does not modify the options in the argument" do
        options = { :only => :name }
        person.serializable_hash(options)
        options[:except].should be_nil
      end

      context "when specifying which fields to only include" do

        it "only includes the specified fields" do
          person.serializable_hash(:only => [:title]).should == { 'title' => attributes['title'] }
        end
      end

      context "when specifying which fields to exclude" do

        it "excludes the specified fields" do
          person.serializable_hash(:except => [:title]).should_not include('title' => attributes['title'])
        end
      end
    end

    context "when a model has dynamic fields" do

      let(:dynamic_field_name) do
        "dynamic_field_name"
      end

      let(:dynamic_value) do
        "dynamic_value"
      end

      before do
        person.write_attribute dynamic_field_name, dynamic_value
      end

      it "includes dynamic fields" do
        person.serializable_hash[dynamic_field_name].should == dynamic_value
      end

      context "when specifying which dynamic fields to only include" do

        it "only includes the specified dynamic fields" do
          person.serializable_hash(:only => [dynamic_field_name]).should == { dynamic_field_name => dynamic_value }
        end
      end

      context "when specified which dynamic fields to exclude" do

        it "excludes the specified fields" do
          person.serializable_hash(:except => [dynamic_field_name]).should_not include(dynamic_field_name => dynamic_value)
        end
      end
    end

    context "when including methods" do

      it "includes the method result" do
        person.serializable_hash(:methods => [:foo]).should include('foo' => person.foo)
      end
    end

    context "when including relations" do

      context "when including a single relation" do

        context "when including an embeds many" do

          let!(:address_one) do
            person.addresses.build(:street => "Kudamm")
          end

          let!(:address_two) do
            person.addresses.build(:street => "Tauentzienstr")
          end

          let(:relation_hash) do
            hash["addresses"]
          end

          pending "when the ids were not loaded" do

            before do
              person.save
            end

            let(:from_db) do
              Person.only("addresses.street").first
            end

            let(:hash) do
              from_db.serializable_hash
            end

            it "does not generate new ids" do
              hash["addresses"].first["_id"].should be_nil
            end
          end

          context "when providing the include as a symbol" do

            let(:hash) do
              person.serializable_hash(:include => :addresses)
            end

            it "includes the first relation" do
              relation_hash[0].should include
                { "_id" => "kudamm", "street" => "Kudamm" }
            end

            it "includes the second relation" do
              relation_hash[1].should include
                { "_id" => "tauentzienstr", "street" => "Tauentzienstr" }
            end
          end

          context "when providing the include as an array" do

            let(:hash) do
              person.serializable_hash(:include => [ :addresses ])
            end

            it "includes the first relation" do
              relation_hash[0].should include
                { "_id" => "kudamm", "street" => "Kudamm" }
            end

            it "includes the second relation" do
              relation_hash[1].should include
                { "_id" => "tauentzienstr", "street" => "Tauentzienstr" }
            end
          end

          context "when providing the include as a hash" do

            context "when including one level deep" do

              let(:hash) do
                person.serializable_hash(:include => { :addresses => { :except => :_id } })
              end

              it "includes the first relation sans exceptions" do
                relation_hash[0].should include({ "street" => "Kudamm" })
              end

              it "includes the second relation sans exceptions" do
                relation_hash[1].should include({ "street" => "Tauentzienstr" })
              end
            end

            context "when including multiple levels deep" do

              let!(:location) do
                address_one.locations.build(:name => "Home")
              end

              let(:hash) do
                person.serializable_hash(
                  :include => { :addresses => {
                    :except => :_id, :include => { :locations => { :except => :_id } }
                  }
                })
              end

              it "includes the first relation" do
                relation_hash[0]["locations"].any? { |location| location['name'] == "Home" }.should be_true
              end

              context "after retrieved from database" do

                let(:db_person) { Person.all.last }

                let!(:second_location) do
                  address_two.locations.build(:name => "Hotel")
                end

                let(:hash) do
                  db_person.serializable_hash(
                    :include => { :addresses => {
                      :except => :_id, :include => { :locations => { :except => :_id } }
                    }
                  })
                end

                before do
                  person.save
                end

                it "includes the specific ralations" do
                  relation_hash[0]["locations"].map { |location| location['name'] }.should include "Home"
                  relation_hash[1]["locations"].map { |location| location['name'] }.should include "Hotel"
                end
              end
            end

            context "when defining a default exclusion" do

              let!(:name) do
                person.build_name(:first_name => "Sebastien")
              end

              let(:hash) do
                person.serializable_hash(
                  :except => :_id,
                  :include => [ :addresses, :name ]
                )
              end

              it "does not contain the root exclusion" do
                hash["_id"].should be_nil
              end

              it "does not include the embedded many exclusion" do
                relation_hash[0]["_id"].should be_nil
              end

              it "does not include the embedded one exclusion" do
                hash["name"]["_id"].should be_nil
              end
            end
          end
        end

        context "when including an embeds one" do

          let!(:name) do
            person.build_name(:first_name => "Leo", :last_name => "Marvin")
          end

          let(:relation_hash) do
            hash["name"]
          end

          context "when providing the include as a symbol" do

            let(:hash) do
              person.serializable_hash(:include => :name)
            end

            it "includes the specified relation" do
              relation_hash.should include
                { "_id" => "leo-marvin", "first_name" => "Leo", "last_name" => "Marvin" }
            end
          end

          context "when providing the include as an array" do

            let(:hash) do
              person.serializable_hash(:include => [ :name ])
            end

            it "includes the specified relation" do
              relation_hash.should include
                { "_id" => "leo-marvin", "first_name" => "Leo", "last_name" => "Marvin" }
            end
          end

          context "when providing the include as a hash" do

            let(:hash) do
              person.serializable_hash(:include => { :name => { :except => :_id }})
            end

            it "includes the specified relation sans exceptions" do
              relation_hash.should include
                { "first_name" => "Leo", "last_name" => "Marvin" }
            end
          end
        end

        context "when including a references many" do

          let!(:post_one) do
            person.posts.build(:title => "First")
          end

          let!(:post_two) do
            person.posts.build(:title => "Second")
          end

          let(:relation_hash) do
            hash["posts"]
          end

          context "when providing the include as a symbol" do

            let(:hash) do
              person.serializable_hash(:include => :posts)
            end

            it "includes the specified relation" do
              relation_hash.should_not be_nil
            end

            it "includes the first document related fields" do
              relation_hash[0]["title"].should == "First"
            end

            it "includes the second document related fields" do
              relation_hash[1]["title"].should == "Second"
            end
          end

          context "when providing the include as an array" do

            let(:hash) do
              person.serializable_hash(:include => [ :posts ])
            end

            it "includes the specified relation" do
              relation_hash.should_not be_nil
            end

            it "includes the first document related fields" do
              relation_hash[0]["title"].should == "First"
            end

            it "includes the second document related fields" do
              relation_hash[1]["title"].should == "Second"
            end
          end

          context "when providing the include as a hash" do

            let(:hash) do
              person.serializable_hash(:include => { :posts => { :except => :_id } })
            end

            it "includes the specified relation" do
              relation_hash.should_not be_nil
            end

            it "includes the first document related fields" do
              relation_hash[0]["title"].should == "First"
            end

            it "includes the second document related fields" do
              relation_hash[1]["title"].should == "Second"
            end

            it "does not include the first document exceptions" do
              relation_hash[0]["_id"].should be_nil
            end

            it "does not include the second document exceptions" do
              relation_hash[1]["_id"].should be_nil
            end
          end
        end

        context "when including a references many to many" do

          let!(:preference_one) do
            person.preferences.build(:name => "First")
          end

          let!(:preference_two) do
            person.preferences.build(:name => "Second")
          end

          let(:relation_hash) do
            hash["preferences"]
          end

          context "when providing the include as a symbol" do

            let(:hash) do
              person.serializable_hash(:include => :preferences)
            end

            it "includes the specified relation" do
              relation_hash.should_not be_nil
            end

            it "includes the first document related fields" do
              relation_hash[0]["name"].should == "First"
            end

            it "includes the second document related fields" do
              relation_hash[1]["name"].should == "Second"
            end
          end

          context "when providing the include as an array" do

            let(:hash) do
              person.serializable_hash(:include => [ :preferences ])
            end

            it "includes the specified relation" do
              relation_hash.should_not be_nil
            end

            it "includes the first document related fields" do
              relation_hash[0]["name"].should == "First"
            end

            it "includes the second document related fields" do
              relation_hash[1]["name"].should == "Second"
            end
          end

          context "when providing the include as a hash" do

            let(:hash) do
              person.serializable_hash(
                :include => {
                  :preferences => {
                    :except => :_id
                  }
                },
                :except => :preference_ids
              )
            end

            it "includes the specified relation" do
              relation_hash.should_not be_nil
            end

            it "includes the first document related fields" do
              relation_hash[0]["name"].should == "First"
            end

            it "includes the second document related fields" do
              relation_hash[1]["name"].should == "Second"
            end

            it "does not include the first document exceptions" do
              relation_hash[0]["_id"].should be_nil
            end

            it "does not include the second document exceptions" do
              relation_hash[1]["_id"].should be_nil
            end

            it "does not include the root exceptions" do
              hash["preference_ids"].should be_nil
            end
          end
        end
      end
    end
  end

  describe "#to_json" do

    let(:person) do
      Person.new
    end

    context "when including root in json" do

      before do
        Mongoid.include_root_in_json = true
      end

      it "uses the mongoid configuration" do
        person.to_json.should include("person")
      end
    end

    context "when not including root in json" do

      before do
        Mongoid.include_root_in_json = false
      end

      it "uses the mongoid configuration" do
        person.to_json.should_not include("person")
      end
    end

    context "when serializing a relation directly" do

      context "when serializing an embeds many" do

        let!(:address) do
          person.addresses.build(:street => "Kudamm")
        end

        let(:json) do
          person.addresses.to_json
        end

        it "serializes only the relation" do
          json.should include(address.street)
        end
      end

      context "when serializing a references many" do

        let!(:post) do
          person.posts.build(:title => "testing")
        end

        let(:json) do
          person.posts.to_json
        end

        it "serializes only the relation" do
          json.should include(post.title)
        end
      end
    end
  end

  describe "#to_xml" do

    context "BSON::ObjectId" do
      let(:person) { Person.new }

      it "serializes as string" do
        person.to_xml.should include("<_id>#{person.id}</_id>")
      end
    end

    context "when an Array field is defined" do

      let(:person) do
        Person.new(
          :aliases => [ "Kelly", "Machine Gun" ]
        )
      end

      it "properly types the array" do
        person.to_xml.should include("<aliases type=\"array\">")
      end

      it "serializes the array" do
        person.to_xml.should include("<alias>Kelly</alias>")
        person.to_xml.should include("<alias>Machine Gun</alias>")
      end
    end

    context "when a Hash field is defined" do

      let(:person) do
        Person.new(
          :map => { :lat => 24.5, :long => 22.1 }
        )
      end

      it "properly types the hash" do
        person.to_xml.should include("<map>")
      end

      it "serializes the hash" do
        person.to_xml.should include("<lat type=\"float\">24.5</lat>")
        person.to_xml.should include("<long type=\"float\">22.1</long>")
      end
    end
  end
end


text:
// Generated by the protocol buffer compiler.  DO NOT EDIT!
// source: google/cloud/channel/v1/service.proto

package com.google.cloud.channel.v1;

public interface ListCustomerRepricingConfigsRequestOrBuilder
    extends
    // @@protoc_insertion_point(interface_extends:google.cloud.channel.v1.ListCustomerRepricingConfigsRequest)
    com.google.protobuf.MessageOrBuilder {

  /**
   *
   *
   *

   * Required. The resource name of the customer.
   * Parent uses the format: accounts/{account_id}/customers/{customer_id}.
   * Supports accounts/{account_id}/customers/- to retrieve configs for all
   * customers.
   *

   *
   *
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The parent.
   */
  java.lang.String getParent();
  /**
   *
   *
   *

   * Required. The resource name of the customer.
   * Parent uses the format: accounts/{account_id}/customers/{customer_id}.
   * Supports accounts/{account_id}/customers/- to retrieve configs for all
   * customers.
   *

   *
   *
   * string parent = 1 [(.google.api.field_behavior) = REQUIRED, (.google.api.resource_reference) = { ... }
   *
   *
   * @return The bytes for parent.
   */
  com.google.protobuf.ByteString getParentBytes();

  /**
   *
   *
   *

   * Optional. The maximum number of repricing configs to return. The service may return
   * fewer than this value. If unspecified, returns a maximum of 50 rules. The
   * maximum value is 100; values above 100 will be coerced to 100.
   *

   *
   * int32 page_size = 2 [(.google.api.field_behavior) = OPTIONAL];
   *
   * @return The pageSize.
   */
  int getPageSize();

  /**
   *
   *
   *

   * Optional. A token identifying a page of results beyond the first page.
   * Obtained through
   * [ListCustomerRepricingConfigsResponse.next_page_token][google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.next_page_token] of the previous
   * [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs] call.
   *

   *
   * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
   *
   * @return The pageToken.
   */
  java.lang.String getPageToken();
  /**
   *
   *
   *

   * Optional. A token identifying a page of results beyond the first page.
   * Obtained through
   * [ListCustomerRepricingConfigsResponse.next_page_token][google.cloud.channel.v1.ListCustomerRepricingConfigsResponse.next_page_token] of the previous
   * [CloudChannelService.ListCustomerRepricingConfigs][google.cloud.channel.v1.CloudChannelService.ListCustomerRepricingConfigs] call.
   *

   *
   * string page_token = 3 [(.google.api.field_behavior) = OPTIONAL];
   *
   * @return The bytes for pageToken.
   */
  com.google.protobuf.ByteString getPageTokenBytes();

  /**
   *
   *
   *

   * Optional. A filter for [CloudChannelService.ListCustomerRepricingConfigs]
   * results (customer only). You can use this filter when you support
   * a BatchGet-like query.
   * To use the filter, you must set `parent=accounts/{account_id}/customers/-`.
   * Example: customer = accounts/account_id/customers/c1 OR
   * customer = accounts/account_id/customers/c2.
   *

   *
   * string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
   *
   * @return The filter.
   */
  java.lang.String getFilter();
  /**
   *
   *
   *

   * Optional. A filter for [CloudChannelService.ListCustomerRepricingConfigs]
   * results (customer only). You can use this filter when you support
   * a BatchGet-like query.
   * To use the filter, you must set `parent=accounts/{account_id}/customers/-`.
   * Example: customer = accounts/account_id/customers/c1 OR
   * customer = accounts/account_id/customers/c2.
   *

   *
   * string filter = 4 [(.google.api.field_behavior) = OPTIONAL];
   *
   * @return The bytes for filter.
   */
  com.google.protobuf.ByteString getFilterBytes();
}


text:
User Edit

Backend

User - Modifica

        <form class="form">

                        Definizioni Generali

                        <button class="btn darkorange" (click)="editMode()">

                            Edit
                        </button>

                                            Nome

                                                <input type="text" class="form-control" name="nome" [ngModel] = "user.name" placeholder="Nome" id="nome" *ngIf="isEdit === false; else editName" readonly>
                                                <ng-template #editName>
                                                    <input type="text" class="form-control" name="nome" placeholder="Nome" id="nome" [(ngModel)] = "user.name" >
                                                </ng-template>

                                            Password

                                                <input type="password" class="form-control" name="password" [ngModel] = "user.password" placeholder="password" id="password" *ngIf="isEdit === false; else editPassword" readonly>
                                                <ng-template #editPassword>
                                                    <input type="password" class="form-control" name="password" placeholder="password" id="password" [(ngModel)] = "user.password">
                                                </ng-template>

                                            Confirm Password

                                                <input type="password" class="form-control" name="confirmPassword" placeholder="Confirm Password" id="confirmPassword" *ngIf="isEdit === false; else editConfirmPassword" readonly>
                                                <ng-template #editConfirmPassword>
                                                    <input type="password" class="form-control" name="confirmPassword" placeholder="Confirm Password" id="confirmPassword" [(ngModel)]="confirm">
                                                </ng-template>

                    <button class="btn orange" (click)="saveMode()">Save</button>
                    <button class="btn red" (click)="resetMode()">Reset</button>

        </form>


text:
#ifndef DCFIELD_H
#define DCFIELD_H

#include "dcbase.h"
#include "dcPackerInterface.h"
#include "dcKeywordList.h"
#include "dcPython.h"

#ifdef WITHIN_PANDA
#include "pStatCollector.h"
#endif

class DCPacker;
class DCAtomicField;
class DCMolecularField;
class DCParameter;
class DCSwitch;
class DCClass;
class HashGenerator;

/**
 * A single field of a Distributed Class, either atomic or molecular.
 */
class EXPCL_DIRECT_DCPARSER DCField : public DCPackerInterface, public DCKeywordList {
public:
  DCField();
  DCField(const std::string &name, DCClass *dclass);
  virtual ~DCField();

PUBLISHED:
  INLINE int get_number() const;
  INLINE DCClass *get_class() const;

  virtual DCField *as_field();
  virtual const DCField *as_field() const;
  virtual DCAtomicField *as_atomic_field();
  virtual const DCAtomicField *as_atomic_field() const;
  virtual DCMolecularField *as_molecular_field();
  virtual const DCMolecularField *as_molecular_field() const;
  virtual DCParameter *as_parameter();
  virtual const DCParameter *as_parameter() const;

  std::string format_data(const std::string &packed_data, bool show_field_names = true);
  std::string parse_string(const std::string &formatted_string);

  bool validate_ranges(const std::string &packed_data) const;

  INLINE bool has_default_value() const;
  INLINE const std::string &get_default_value() const;

  INLINE bool is_bogus_field() const;

  INLINE bool is_required() const;
  INLINE bool is_broadcast() const;
  INLINE bool is_ram() const;
  INLINE bool is_db() const;
  INLINE bool is_clsend() const;
  INLINE bool is_clrecv() const;
  INLINE bool is_ownsend() const;
  INLINE bool is_ownrecv() const;
  INLINE bool is_airecv() const;

  INLINE void output(std::ostream &out) const;
  INLINE void write(std::ostream &out, int indent_level) const;

#ifdef HAVE_PYTHON
  bool pack_args(DCPacker &packer, PyObject *sequence) const;
  PyObject *unpack_args(DCPacker &packer) const;

  void receive_update(DCPacker &packer, PyObject *distobj) const;

  Datagram client_format_update(DOID_TYPE do_id, PyObject *args) const;
  Datagram ai_format_update(DOID_TYPE do_id, CHANNEL_TYPE to_id, CHANNEL_TYPE from_id,
                            PyObject *args) const;
  Datagram ai_format_update_msg_type(DOID_TYPE do_id, CHANNEL_TYPE to_id, CHANNEL_TYPE from_id,
                            int msg_type, PyObject *args) const;
#endif

public:
  virtual void output(std::ostream &out, bool brief) const=0;
  virtual void write(std::ostream &out, bool brief, int indent_level) const=0;
  virtual void generate_hash(HashGenerator &hashgen) const;
  virtual bool pack_default_value(DCPackData &pack_data, bool &pack_error) const;
  virtual void set_name(const std::string &name);

  INLINE void set_number(int number);
  INLINE void set_class(DCClass *dclass);
  INLINE void set_default_value(const std::string &default_value);

#ifdef HAVE_PYTHON
  static std::string get_pystr(PyObject *value);
#endif

protected:
  void refresh_default_value();

protected:
  DCClass *_dclass;
  int _number;
  bool _default_value_stale;
  bool _has_default_value;
  bool _bogus_field;

private:
  std::string _default_value;

#ifdef WITHIN_PANDA
  PStatCollector _field_update_pcollector;
#endif
};

INLINE std::ostream &operator << (std::ostream &out, const DCField &field) {
  field.output(out);
  return out;
}

#include "dcField.I"

#endif