text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayout xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:id="@+id/activity_main"
    tools:context="com.example.ychav.expouvg.MainActivity">

    <ScrollView

        android:layout_width="368dp"
        android:layout_height="495dp"
        android:fillViewport="true"
        android:layout_alignParentTop="true"
        android:layout_alignParentLeft="true"
        android:layout_alignParentStart="true"
        android:scrollbars = "vertical"
        android:scrollbarStyle="insideInset"
        tools:ignore="UselessParent"
        android:id="@+id/scroll"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintTop_toTopOf="parent"
        android:background="@android:color/background_light">

        <TableLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:stretchColumns="1">

            <TableRow>
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="16dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toTopOf="parent"
                android:id="@+id/tableRow1">

                <ImageView
                    android:id="@+id/reto1Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto1Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto1Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button1"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>
            <TableRow>
                android:id="@+id/tableRow2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow1">

                <ImageView
                    android:id="@+id/reto2Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    app:layout_constraintLeft_toLeftOf="parent"
                    app:layout_constraintTop_toBottomOf="@+id/tableRow1"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto2Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto2Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button2"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>
            <TableRow>
                android:id="@+id/tableRow3"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow2">

                <ImageView
                    android:id="@+id/reto3Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto3Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto3Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button3"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>
            <TableRow>
                android:id="@+id/tableRow4"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow3">

                <ImageView
                    android:id="@+id/reto4Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto4Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto4Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button4"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>
            <TableRow>
                android:id="@+id/tableRow5"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow4">

                <ImageView
                    android:id="@+id/reto5Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto5Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto5Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button5"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>
            <TableRow>
                android:id="@+id/tableRow6"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow5">

                <ImageView
                    android:id="@+id/reto6Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto6Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto6Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button6"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>
            <TableRow>
                android:id="@+id/tableRow7"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow6">

                <ImageView
                    android:id="@+id/reto7Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto7Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto7Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button7"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>

            <TableRow>
                android:id="@+id/tableRow8"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow7">

                <ImageView
                    android:id="@+id/reto8Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto8Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto8Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button8"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>

            <TableRow>
                android:id="@+id/tableRow9"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow8">

                <ImageView
                    android:id="@+id/reto9Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto9Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto9Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button9"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>

            <TableRow>
                android:id="@+id/tableRow10"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow9">

                <ImageView
                    android:id="@+id/reto10Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto10Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto10Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button10"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>

            <TableRow>
                android:id="@+id/tableRow11"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="31dp"
                android:layout_marginTop="10dp"
                app:layout_constraintLeft_toLeftOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/tableRow10">

                <ImageView
                    android:id="@+id/reto11Img1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto11Img2"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <ImageView
                    android:id="@+id/reto11Img3"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="5dip"
                    android:layout_marginTop="10dip"
                    android:src="@drawable/star_verde"
                    tools:ignore="ContentDescription"
                    >
                </ImageView>

                <Button
                    android:id="@+id/button11"
                    android:text="@string/ver_reto"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginLeft="5dip"
                    android:layout_marginRight="152dip"
                    android:layout_marginTop="10dip"
                    style="@android:style/Widget.DeviceDefault.Button"
                    android:minHeight="55dp"
                    android:backgroundTint="#010166"
                    android:textSize="14sp"
                    android:textColor="@android:color/background_light"
                    android:minWidth="88dp" />

            </TableRow>

            <TableRow>
            android:id="@+id/tableRow12"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="31dp"
            android:layout_marginTop="10dp"
            app:layout_constraintLeft_toLeftOf="parent"
            app:layout_constraintTop_toBottomOf="@+id/tableRow11">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:id="@+id/textView"
                    android:textSize="70sp" />
            </TableRow>

        </TableLayout>
    </ScrollView>

</android.support.constraint.ConstraintLayout>


text:
import * as settings from './settings';
import * as regions from './regions';
import * as languages from './languages';
import * as data from './data';
import * as schedules from './schedules';
import * as salmonRun from './salmonRun';
import * as splatfests from './splatfests';
import * as splatNetStore from './splatNetStore';
import * as newWeapons from './newWeapons';
import * as finalFest from './finalFest';

let updateNowTimer;

const state = {
    now: null,
};

const getters = {
    now(state) {
        return state.now;
    },
};

const actions = {
    updateNow({ state, commit }) {
        let now = Math.trunc((new Date).getTime() / 1000);

        if (state.now != now)
            commit('UPDATE_NOW', { now });
    },
    setNow({ commit }, { now }) {
        commit('UPDATE_NOW', { now });
    },
    startUpdatingNow({ dispatch }) {
        if (updateNowTimer)
            return;

        dispatch('updateNow');

        updateNowTimer = setInterval(() => {
            dispatch('updateNow');
        }, 200);
    },
    stopUpdatingNow() {
        clearInterval(updateNowTimer);
        updateNowTimer = null;
    },
};

const mutations = {
    UPDATE_NOW(state, { now }) {
        state.now = now;
    },
};

export default {
    namespaced: true,
    state,
    getters,
    actions,
    mutations,
    modules: {
        settings,
        regions,
        languages,
        data,
        schedules,
        salmonRun,
        splatfests,
        splatNetStore,
        newWeapons,
        finalFest,
    },
};

redpajama_set_name: RedPajamaGithub


text:
<?php

// Disallow direct access to this file
defined('_JEXEC') or die('Restricted access');
?>
<fieldset class="adminform">
	<legend><?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_REPORTINGS' ); ?></legend>
	<?php echo JText::_('COM_COMMUNITY_DOC'); ?>

					<span class="hasTip" title="::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_REPORTINGS_ENABLE_TIPS'); ?>">
						<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_REPORTINGS_ENABLE' ); ?>

					<?php echo JHTML::_('select.booleanlist' , 'enablereporting' , null , $this->config->get('enablereporting') , JText::_('COM_COMMUNITY_YES_OPTION') , JText::_('COM_COMMUNITY_NO_OPTION') ); ?>

					<span class="hasTip" title="::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_REPORTINGS_EXECUTE_DEFAULT_TASK_TIPS'); ?>">
						<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_REPORTINGS_EXECUTE_DEFAULT_TASK' ); ?>

					<input type="text" name="maxReport" style="text-align: center;" value="<?php echo $this->config->get('maxReport'); ?>" size="5" />
					<?php echo JText::_('COM_COMMUNITY_REPORTS');?>

					<span class="hasTip" title="::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_REPORTINGS_NOTIFICATION_EMAIL_TIPS'); ?>">
						<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_REPORTINGS_NOTIFICATION_EMAIL' ); ?>

<input type="text" name="notifyMaxReport" value="<?php echo $this->config->get('notifyMaxReport'); ?>" size="45" />

					<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_REPORTINGS_NOTIFICATION_EMAIL_COMMA_SEPARATED');?>

					<span class="hasTip" title="::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_REPORTINGS_ALLOW_GUEST_TIPS'); ?>">
						<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_REPORTINGS_ALLOW_GUEST' ); ?>

					<?php echo JHTML::_('select.booleanlist' , 'enableguestreporting' , null , $this->config->get('enableguestreporting') , JText::_('COM_COMMUNITY_ALLOWED_OPTION') , JText::_('COM_COMMUNITY_DISALLOWED_OPTION') ); ?>

					<span class="hasTip" title="::<?php echo JText::_('COM_COMMUNITY_CONFIGURATION_REPORTINGS_PREDEFINED_TEXT_TIPS'); ?>">
					<?php echo JText::_( 'COM_COMMUNITY_CONFIGURATION_REPORTINGS_PREDEFINED_TEXT' ); ?>

					<textarea name="predefinedreports" cols="30" rows="5"><?php echo $this->config->get('predefinedreports');?></textarea>

</fieldset>


text:
/**
 * @file
 * @brief Inheritance example
 * @date 28.12.12
 * @author Felix Sulima
 */

#include <framework/example/self.h>

#include <new>
#include <cstdio>

// TEST: include all C++ headers
#include <cassert>
#include <cctype>
#include <cerrno>
#include <cmath>
#include <csetjmp>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <exception>
#include <new>
#include <typeinfo>
// END TEST

EMBOX_EXAMPLE(run);

class Base;
typedef void (* pbase_fn_t) (Base &base);

class Base {
public:
	Base(pbase_fn_t fn) {
		std::printf(">> [obj %p] Base(%p)\n", this, fn);
		if (fn) {
			fn(*this);
		}
	}
	virtual void testPureVirtual(void) = 0;
	virtual ~Base() = 0;
};

Base::~Base() {
	std::printf(">> [obj %p] ~Base()\n", this);
}

class Derived : public Base {
public:
	virtual void testPureVirtual(void) { std::printf(">> [obj %p] Derived.testPureVirtual() without any arguments\n", this); }
	Derived(pbase_fn_t fn) : Base(fn) { std::printf(">> [obj %p] Derived(%p)\n", this, fn); }
	~Derived() { std::printf(">> [obj %p] ~Derived()\n", this); }
};

static void callPureVirtual(Base& base) {
	assert(true);
	base.testPureVirtual();
}

static int run(int argc, char **argv) {

	// stack
	{
		std::puts("Derived without any arguments -- on stack");
		Derived derived();
	}

	// Null argument
	{
		std::puts("Derived with NULL argument -- on stack");
		Derived derived(NULL);
	}

	// Calling pure virtual function
	{
		std::puts("Calling pure virtual function");
		Derived derived(callPureVirtual);
	}

	return 0;
}


text:
from __future__ import unicode_literals

from django.db import models, migrations
from django.conf import settings

class Migration(migrations.Migration):

    dependencies = [
        ('greencoffees', '0010_auto_20150911_0039'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('roastlogs', '0002_remove_roastlogs_green_coffee'),
    ]

    operations = [
        migrations.CreateModel(
            name='Orders',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('create_at', models.DateField(null=True, blank=True)),
                ('output_at', models.DateField(null=True, blank=True)),
                ('status', models.IntegerField()),
                ('running_total', models.IntegerField()),
                ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'db_table': 'orders',
                'verbose_name_plural': 'Orders',
            },
        ),
        migrations.CreateModel(
            name='Products',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('list_price', models.IntegerField()),
                ('weight', models.IntegerField()),
                ('create_at', models.DateField()),
                ('status', models.IntegerField()),
                ('green_coffee', models.ForeignKey(to='greencoffees.GreenCoffees')),
            ],
            options={
                'db_table': 'products',
                'verbose_name_plural': 'Products',
            },
        ),
        migrations.CreateModel(
            name='SellingItems',
            fields=[
                ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
                ('selling_price', models.IntegerField()),
                ('order', models.ForeignKey(to='orders.Orders')),
                ('product', models.ForeignKey(to='orders.Products')),
                ('roastlog', models.ForeignKey(blank=True, to='roastlogs.Roastlogs', null=True)),
            ],
            options={
                'db_table': 'selling_items',
                'verbose_name_plural': 'Selling Items',
            },
        ),
    ]


text:
/* Commentary:
 *
 */

/* Change log:
 *
 */

#pragma once

#include "dtkComposerExport.h"

#include <QtWidgets>

class dtkComposerStack;
class dtkComposerStackViewPrivate;

class DTKCOMPOSER_EXPORT dtkComposerStackView : public QWidget
{
    Q_OBJECT

public:
     dtkComposerStackView(QWidget *parent = 0);
    ~dtkComposerStackView(void);

public:
    void setStack(dtkComposerStack *stack);

private:
    dtkComposerStackViewPrivate *d;
};


text:
'use strict';

const APP_CONST = require('../../constant/app');

/**
 * Text handler
 * @param {any} id
 * @param {any} text
 * @returns
 */
module.exports = (id, text) => (
  {
    recipient: { id },
    message: text
  }
);


text:
define(['config/config', 'logger', 'tracker', 'backbone', 'jquery', 'voc','underscore',
        'data/AppData',
        'data/timeline/TimelineData',
        'data/organize/OrganizeData',
        'data/episode/UserData',
        'data/episode/EpisodeData',
        'data/episode/VersionData',
        'view/WidgetView',
        'view/episode/EpisodeManagerView',
        'view/toolbar/ToolbarView',
        'view/modal/CircleRenameModalView',
        'view/modal/OIDCTokenExpiredModalView',
        'utils/SystemMessages',
        'utils/EntityHelpers',
        'text!templates/navbar.tpl'],
    function(appConfig, Logger, tracker, Backbone, $, Voc, _, AppData, TimelineData, OrganizeData, UserData, EpisodeData, VersionData,WidgetView, EpisodeManagerView, ToolbarView, CircleRenameModalView, OIDCTokenExpiredModalView, SystemMessages, EntityHelpers, NavbarTemplate){
        AppLog = Logger.get('App');
        return Backbone.View.extend({
            events : {
                'bnp:clickEntity' : 'clickEntity',
                'bnp:showHideToolbar' : 'handleShowHideToolbar',
                'bnp:newEntityAdded' : 'handleNewEntityAdded'
            },
            _calculateAndSetScrollableMenuMaxHeight: function() {
                var windowHeight = $(window).height(),
                    navbarHeight = this.$el.parent().find('.navbar').height();
                this.$el.parent().find('.bnp-scrollable-menu').css('max-height', windowHeight - navbarHeight - 50);
            },
            initialize: function() {
                this.vie = this.options.vie;
                this.widgetViews = [];

                this.vie.entities.on('add', this.filter, this );
                var that = this;
                this.model.on('change:'
                    + this.vie.namespaces.uri(Voc.currentVersion),
                    function(model, value, options) {
                        version = model.get(Voc.currentVersion);
                        if( version && version.isEntity) that.show(version);
                    }, this);
                this.model.on('change:'
                    + this.vie.namespaces.uri(Voc.label),
                    function(model, value, options) {
                        that.$el.parent().find('.currentUserLabel').html(model.get(Voc.label).split('@')[0]);
                    },this);
                this.model.on('change:'
                    + this.vie.namespaces.uri(Voc.hasEpisode),
                    function(model, value, options) {
                        if ( false === value ) {
                            SystemMessages.addWarningMessage('You have no episodes. Please open the Menu and choose Create New Episode!', false);
                        }
                    },this);
                this.setUpEpisodeLockHoldInternal();
                this.setUpWorksLogInterval();
                this.timelineModel = this.vie.entities.addOrUpdate(
                        AppData.createTimeline(this.model));
                tracker.info(tracker.STARTBITSANDPIECES, null);

                this.timerId = null;
                $(window).on('resize', function() {
                    if ( that.timerId ) {
                        clearTimeout(that.timerId);
                    }

                    that.timerId = setTimeout(function() {
                        that.timerId = null;
                        that._calculateAndSetScrollableMenuMaxHeight();
                    }, 500);
                });
            },
            filter: function(model, collection, options) {
                if(model.isof(Voc.VERSION)){
                    var version = model;
                    var AppView = this;
                    AppLog.debug('version added', model);

                    // draw already existing widgets
                    this.draw(version);

                    // draw widgets as soon as they are added to the version
                    version.on('change:' + this.vie.namespaces.uri(Voc.hasWidget), function(model, widgets, options) {

                        AppLog.debug('Version hasWidget changed', widgets);
                        AppView.draw(model);
                    });
                }
            },
            render: function() {
                var navbar = _.template(NavbarTemplate, {
                    userLabel: this.model.get(Voc.label),
                    affectUrl: appConfig.affectUrl || '',
                    helpUrl: appConfig.helpUrl || '#',
                    discussionToolUrl: appConfig.discussionToolUrl || ''
                });

                // Prepend navbar to body
                this.$el.parent().prepend(navbar);

                this._calculateAndSetScrollableMenuMaxHeight();

                this.widgetFrame = $('

');
                this.$el.append( this.widgetFrame );
                this.episodeSpecificContainer = this.widgetFrame.find('.episodeSpecificContainer');
                this.episodeMgrView = new EpisodeManagerView({
                    model: this.model,
                    el: 'nav',
                    vie : this.vie
                });
                this.episodeMgrView.render();

                var toolbar = $('

');
                this.$el.append( toolbar );
                this.toolbarView = new ToolbarView({
                    model: this.model,
                    el : toolbar
                });
                this.toolbarView.render();

                // Initialize and place the CircleRenameMoval view
                this.circleRenameModalView = new CircleRenameModalView().render();
                this.$el.parent().prepend(this.circleRenameModalView.$el);

                // Initialize and place the OIDCTokenExpired view
                this.oidcTokenExpiredModalView = new OIDCTokenExpiredModalView().render();
                this.$el.parent().prepend(this.oidcTokenExpiredModalView.$el);

                this.drawWidget(this.$el.find('.timelineContainer'), this.timelineModel);
            },
            drawWidget: function(versionElem, widget) {
                AppLog.debug('drawWidget', widget);
                if( !widget.isEntity )
                    widget =  this.vie.entities.get(widget);
                if( !widget ) {
                    AppLog.debug("drawWidget of inexistent widget called");
                    return;
                }

                var widgetView = new WidgetView({
                    model: widget,
                    tagName: 'fieldset',
                    circleRenameModalView: this.circleRenameModalView
                });
                if( widgetView.isBrowse() ) {
                    versionElem.prepend(widgetView.$el);
                }else if( widgetView.isOrganize() ) {
                    versionElem.append(widgetView.$el);
                }
                widgetView.render();
                this.widgetViews.push(widgetView);
            },
            draw: function(version) {
                if( !version ) return;
                if( !version.isEntity )  {
                    if(!(version = this.vie.entities.get(version)))
                        return;
                }
                AppLog.debug('drawing ', version.getSubject());
                var versionElem = this.episodeSpecificContainer.children('*[about="'+version.getSubject()+'"]').first();
                AppLog.debug('versionElem', versionElem);
                if( versionElem.length === 0) {
                    versionElem = $('

');
                    this.episodeSpecificContainer.append(versionElem);
                    version.once('change:' + version.idAttribute, function(model, value, options) {
                        AppLog.debug('change subject from', model.cid, 'to', value);
                        versionElem.attr('about', value);
                    });
                }
                var widgets = version.get(Voc.hasWidget) || [];
                if( !_.isArray(widgets)) widgets = [widgets];
                if( !widgets || widgets.length === 0 ) return;

                var abouts = versionElem.children().map(function(i, c){
                    return c.getAttribute('about');
                });
                var that = this;
                _.each(widgets, function(widget){
                    if( !_.contains(abouts, widget.getSubject()))
                        that.drawWidget(versionElem, widget);
                });
                if( version === this.model.get(Voc.currentVersion)) {
                    this.show(version);
                } else {
                    versionElem.addClass('widgetHidden');
                }
            },
            show: function(version) {
                if( !version ) return;
                if( !version.isEntity )  {
                    if(!(version = this.vie.entities.get(version)))
                        return;
                }

                AppLog.debug('showing', version.getSubject());

                var that= this;
                this.episodeSpecificContainer.children().addClass('widgetHidden');
                AppLog.debug('hide' , this.episodeSpecificContainer.children());
                var element = this.episodeSpecificContainer.children('*[about="'+version.getSubject()+'"]');
                element.removeClass('widgetHidden');
                element.detach();
                this.episodeSpecificContainer.prepend(element);

                var previousVersion = this.model.previous(Voc.currentVersion);
                // This force redraws current timeline element.
                // This happends due to elements being hidden initially.
                _.each(this.widgetViews, function(widget) {
                    if ( widget.model.get(Voc.belongsToVersion) === version ) {
                        if ( widget.isOrganize() ) {
                            var episode = version.get(Voc.belongsToEpisode);

                            if ( episode && episode.isEntity ) {
                                // TODO See if we need to use the promise to handel success/fail
                                EpisodeData.learnEpLockHold(episode);

                                if ( EntityHelpers.isSharedEpisode(episode) ) {
                                    widget.view.clearOrganizeAndViews();
                                    var versionsPromise = EpisodeData.fetchVersions(episode);
                                    versionsPromise.done(function() {
                                        widget.view.reRenderOrganize();
                                    }).fail(function() {
                                        widget.view.reRenderOrganize();
                                    });
                                }
                            } else {
                                AppLog.debug("Episode Missing From Version, could not check locks", widget.model, version);
                            }
                        }
                    } else if ( widget.model.get(Voc.belongsToVersion) === previousVersion ) {
                        if ( widget.isOrganize() ) {
                            widget.removeEpisodeLockIfNeeded();
                        }
                    }
                });

            },
            browseCurrentBrowseWidget: function(entity) {
                _.each(this.widgetViews, function(widget) {
                    if ( widget.isBrowse() ) {
                        // Call browseTo on current widget view attribute
                        // filled with real widget view
                        widget.view.browseTo(entity);
                    }
                });
            },
            clickEntity: function(e) {
                this.toolbarView.setBit(e.entity);

                if ( e.viewContext && e.viewContext === this.toolbarView ) {
                    AppLog.debug("clickEntity called within ToolbarView context");
                    this.browseCurrentBrowseWidget(e.entity);
                }
            },
            handleShowHideToolbar: function(e) {
                var systemMessages = $(document).find('#systemMessages');

                if ( 'shown' === e.customType ) {
                    systemMessages.toggleClass('systemMessagesToolbarOpen', true, function() {});
                } else {
                    systemMessages.toggleClass('systemMessagesToolbarOpen', false);
                }
            },
            setUpEpisodeLockHoldInternal: function() {
                var that = this;

                setInterval(function() {
                    var version = that.model.get(Voc.currentVersion);

                    if ( version && version.isEntity ) {
                        var episode = version.get(Voc.belongsToEpisode);

                        if ( episode && episode.isEntity ) {
                            var promise = EpisodeData.learnEpLockHold(episode);

                            promise.done(function(result, lockData) {
                                AppLog.debug('learnEpLockHold Succeeded', result, lockData);
                            }).fail(function(f) {
                                AppLog.debug('learnEpLockHold Failed', f);
                            });
                        } else {
                            AppLog.debug('learnEpLockHold No Episoe For Version', version);
                        }
                    } else {
                        AppLog.debug('learnEpLockHold No Current Version For User', that.model);
                    }
                }, 30000);
            },
            setUpWorksLogInterval: function() {
                var that = this;

                setInterval(function() {
                    var version = null,
                        episode = null,
                        episodeUri = null;

                    version = that.model.get(Voc.currentVersion);
                    if ( version && version.isEntity ) {
                        episode = version.get(Voc.belongsToEpisode);

                        if ( episode && episode.isEntity ) {
                            episodeUri = episode.getSubject();
                        }
                    }

                    tracker.info(tracker.WORKSINBITSANDPIECES, null, episodeUri);
                }, 30000);
            },
            handleNewEntityAdded: function(e) {
                _.each(this.widgetViews, function(widget) {
                    if ( widget.isBrowse() ) {
                        widget.view.addSingleNewEntityToTimeline(e.entityUri);
                    }
                });
            }
        });
});


text:
"""utils.py: collection of utility functions for the command line tools"""

# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4

__author__    = "Ole Christian Weidner"
__email__     = "ole.weidner@me.com"
__copyright__ = "Copyright 2011, Ole Christian Weidner"
__license__   = "MIT"

import traceback
import StringIO

def get_traceback(prefix="\n*** "):
    '''returns the last traceback as a string with a given prefix'''
    fp = StringIO.StringIO()
    traceback.print_exc(file=fp)
    return prefix+fp.getvalue()


text:
package com.mimaraslan.aop;
import java.util.Arrays;

import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;

public class CagirilanMetodunOncesiVeSonrasiOzellikleri
								implements MethodInterceptor {
	@Override
	public Object invoke(MethodInvocation methodInvocation)
											throws Throwable {
		// Aynı before metodu gibidir.
		System.out.println("\n****Çağırılan metodun ÖNCEKİ dururmu.");

		System.out.println("****Çağırılan metodun adı : "
				+ methodInvocation.getMethod().getName());

		System.out.println("****Çağırılan metodun argumentleri : "
				+ Arrays.toString(methodInvocation.getArguments()));

	    try {
			// proceed, normal sıradan bir metot çağırımıdır.
			Object result = methodInvocation.proceed();
			// Aynı AfterReturning metodu gibidir.
        System.out.println("****Çağırılan metodun SONRAKİ dururmu.\n");
			return result;

		   } catch (IllegalArgumentException e) {
			// Aynı AfterThrowing metodu gibidir.
		System.out.println("****Çağırılan metotta İSTİSNA "
										   + "meydana gelme dururmu.");
			throw e;
		}
	}
}


text:
#ifndef __ASM_AVR32_SECTIONS_H
#define __ASM_AVR32_SECTIONS_H

#include <asm-generic/sections.h>

/* References to section boundaries */

extern char __data_lma[], __edata_lma[];
extern char __got_start[], __got_lma[], __got_end[];

#endif /* __ASM_AVR32_SECTIONS_H */


text:
import re
import os
import logging
import traceback
from functools import wraps

from django.db import connection, models
from django.conf import settings

logger = logging.getLogger(__name__)

def debug_pg_notices(f):

    @wraps(f)
    def wrapped(*args, **kwargs):
        before = len(connection.connection.notices) if connection.connection else 0
        try:
            r = f(*args, **kwargs)
        finally:
            # Show triggers output
            allnotices = []
            current = ''
            if connection.connection:
                notices = []
                for notice in connection.connection.notices[before:]:
                    try:
                        notice, context = notice.split('CONTEXT:', 1)
                        context = re.sub("\s+", " ", context)
                    except ValueError:
                        context = ''
                    notices.append((context, notice))
                    if context != current:
                        allnotices.append(notices)
                        notices = []
                        current = context
                allnotices.append(notices)
            current = ''
            for notices in allnotices:
                for context, notice in notices:
                    if context != current:
                        if context != '':
                            logger.debug('Context %s...:' % context.strip()[:80])
                        current = context
                    notice = notice.replace('NOTICE: ', '')
                    prefix = '' if context == '' else '        '
                    logger.debug('%s%s' % (prefix, notice.strip()))
        return r

    return wrapped

def load_sql_files(app_label):
    """
    Look for SQL files in Django app, and load them into database.
    We remove RAISE NOTICE instructions from SQL outside unit testing
    since they lead to interpolation errors of '%' character in python.
    """
    app_dir = os.path.dirname(models.get_app(app_label).__file__)
    sql_dir = os.path.normpath(os.path.join(app_dir, 'sql'))
    if not os.path.exists(sql_dir):
        logger.debug("No SQL folder for %s" % app_label)
        return

    r = re.compile(r'^.*\.sql$')
    sql_files = [os.path.join(sql_dir, f)
                 for f in os.listdir(sql_dir)
                 if r.match(f) is not None]
    sql_files.sort()

    if len(sql_files) == 0:
        logger.warning("Empty folder %s" % sql_dir)

    cursor = connection.cursor()
    for sql_file in sql_files:
        try:
            logger.info("Loading initial SQL data from '%s'" % sql_file)
            f = open(sql_file)
            sql = f.read()
            f.close()
            if not settings.TEST:
                # Remove RAISE NOTICE (/!\ only one-liners)
                sql = re.sub(r"\n.*RAISE NOTICE.*\n", "\n", sql)
                # TODO: this is the ugliest driver hack ever
                sql = sql.replace('%', '%%')

            # Replace curly braces with settings values
            pattern = re.compile(r'{{\s*(.*)\s*}}')
            for m in pattern.finditer(sql):
                value = getattr(settings, m.group(1))
                sql = sql.replace(m.group(0), unicode(value))
            cursor.execute(sql)
        except Exception as e:
            logger.critical("Failed to install custom SQL file '%s': %s\n" %
                            (sql_file, e))
            traceback.print_exc()
            raise


text:
package ru.atott.combiq.data.service.impl;

import org.apache.commons.io.IOUtils;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
import org.elasticsearch.client.Client;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ru.atott.combiq.dao.Domains;
import ru.atott.combiq.dao.es.NameVersionDomainResolver;
import ru.atott.combiq.data.service.CreatePersonalIndexService;
import ru.atott.combiq.data.utils.DataUtils;

import java.io.IOException;
import java.io.InputStream;
import java.util.concurrent.ExecutionException;

@Service
public class CreatePersonalIndexServiceImpl implements CreatePersonalIndexService {
    @Autowired(required = false)
    private Client client;
    @Autowired
    private NameVersionDomainResolver domainResolver;

    @Override
    public String create(String env) throws IOException, ExecutionException, InterruptedException {
        domainResolver.reset();

        Long version = domainResolver.getVersionOrDefault(Domains.personal, 0L) + 1;
        String indexName = domainResolver.resolveIndexName(Domains.personal, version);
        InputStream indexStream = this.getClass().getResourceAsStream("/index/personal.json");
        String indexJson = IOUtils.toString(indexStream, "utf-8");
        CreateIndexRequest request = new CreateIndexRequest(indexName);
        request.source(indexJson);
        client.admin().indices().create(request).actionGet();

        domainResolver.reset();
        return indexName;
    }

    @Override
    public String update(String env) throws IOException, ExecutionException, InterruptedException {
        String indexName = domainResolver.resolvePersonalIndex();
        String json = DataUtils.getIndexMapping("/index/personal.json");
        DataUtils.putMapping(client, indexName, json);
        return indexName;
    }
}


text:
/*This file is prepared for Doxygen automatic documentation generation.*/
//! \file *********************************************************************
//!
//! \brief This file redefines dedicated IAR EWAVR and GNU GCC keywords
//! in order to ensure that any source file can be processed by these compilers.
//!
//! - Compiler:           IAR EWAVR and GNU GCC for AVR
//! - Supported devices:  AT90USB162, AT90USB82
//!
//! \author               Atmel Corporation: http://www.atmel.com \n
//!                       Support and FAQ: http://support.atmel.no/
//!
//! ***************************************************************************

/* Copyright (c) 2009 Atmel Corporation. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * 1. Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * 3. The name of Atmel may not be used to endorse or promote products derived
 * from this software without specific prior written permission.
 *
 * 4. This software may only be redistributed and used in connection with an Atmel
 * AVR product.
 *
 * THIS SOFTWARE IS PROVIDED BY ATMEL "AS IS" AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT ARE EXPRESSLY AND
 * SPECIFICALLY DISCLAIMED. IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT,
 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#ifndef _COMPILER_H_
#define _COMPILER_H_

/*_____ I N C L U D E S ____________________________________________________*/

/*_____ D E C L A R A T I O N S ____________________________________________*/
#define LITTLE_ENDIAN

#ifndef ASM_INCLUDE // define ASM_INCLUDE in your a51 source code before include of .h file
typedef float               Float16;

typedef unsigned char       U8 ;
typedef unsigned short      U16;
typedef unsigned long       U32;
typedef signed char         S8 ;
typedef signed short        S16;
typedef long                S32;
typedef unsigned char       Bool;

typedef U8                  Status;
typedef Bool                Status_bool;
#define bool                Bool
#define PASS 0
#define FAIL 1

#if (defined __C51__)
#  define _MEM_TYPE_BIT_              bdata  // Used for bit accesses
#  define _MEM_TYPE_FAST_              data
#  define _MEM_TYPE_MEDFAST_          idata
#  define _MEM_TYPE_MEDSLOW_          pdata
#  define _MEM_TYPE_SLOW_             xdata
#else
#  define _MEM_TYPE_BIT_
#  define _MEM_TYPE_FAST_
#  define _MEM_TYPE_MEDFAST_
#  define _MEM_TYPE_MEDSLOW_
#  define _MEM_TYPE_SLOW_
#endif

typedef unsigned char       Uchar;

typedef unsigned char       Uint8;
typedef unsigned int        Uint16;
typedef unsigned long int   Uint32;

typedef char                Int8;
typedef int                 Int16;
typedef long int            Int32;

typedef unsigned char       Byte;
typedef unsigned int        Word;
typedef unsigned long int   DWord;

typedef union
{
  Uint32 dw; // l changed in dw (double word) because l is used for signed long...
  Uint16 w[2];
  Uint8  b[4];
} Union32;

typedef union
{
  Uint16 w;
  Uint8  b[2];
} Union16;

#ifdef __IAR_SYSTEMS_ICC__
typedef char     bit;
typedef int      p_uart_ptchar;
typedef int      r_uart_ptchar;
#endif
#ifdef __CODEVISIONAVR__
typedef char     bit;
typedef int      p_uart_ptchar;
typedef char     r_uart_ptchar;
#endif
#if !defined(__IAR_SYSTEMS_ICC__) && !defined(___ICC__)
typedef char      p_uart_ptchar;
typedef char      r_uart_ptchar;
#endif

#endif

/**********************************************************************************/
/* codevision COMPILER (__CODEVISIONAVR__)                                                 */
/**********************************************************************************/
#ifdef __ICC__
#define _ConstType_   lit
#define _MemType_
#define _GenericType_ __generic
#define code lit
#define xdata
#define idata
#define data
#endif
/**********************************************************************************/
/* IAR COMPILER (__IAR_SYSTEMS_ICC__)                                             */
/**********************************************************************************/
#ifdef __IAR_SYSTEMS_ICC__
#include "inavr.h"
#define _ConstType_   __flash
#define _MemType_
#define _GenericType_ __generic
#define code __flash
#define farcode __flash
#define xdata
#define idata
#define data
#define At(x) @ x
#define pdata
#define bdata
// Memory Type Location
#ifndef _CONST_TYPE_
#  define _CONST_TYPE_ code
#endif

#define Enable_interrupt()          __enable_interrupt()
#define Disable_interrupt()         __disable_interrupt()
#define Get_interrupt_state()       (SREG&0x80)

#include <iomacro.h>
#define SFR_W_EXT(a,b) SFR_W_R(b,a)

#endif

/*_____ M A C R O S ________________________________________________________*/
/* little-big endian management */
#define INTEL_ALIGNMENT     LITTLE_ENDIAN
#define MOTOROLA_ALIGNMENT  BIG_ENDIAN

// U16/U32 endian handlers
#ifdef LITTLE_ENDIAN     // => 16bit: (LSB,MSB), 32bit: (LSW,MSW) or (LSB0,LSB1,LSB2,LSB3) or (MSB3,MSB2,MSB1,MSB0)
#  define MSB(u16)        (((U8* )&u16)[1])
#  define LSB(u16)        (((U8* )&u16)[0])
#  define MSW(u32)        (((U16*)&u32)[1])
#  define LSW(u32)        (((U16*)&u32)[0])
#  define MSB0(u32)       (((U8* )&u32)[3])
#  define MSB1(u32)       (((U8* )&u32)[2])
#  define MSB2(u32)       (((U8* )&u32)[1])
#  define MSB3(u32)       (((U8* )&u32)[0])
#  define LSB0(u32)       MSB3(u32)
#  define LSB1(u32)       MSB2(u32)
#  define LSB2(u32)       MSB1(u32)
#  define LSB3(u32)       MSB0(u32)
#else // BIG_ENDIAN         => 16bit: (MSB,LSB), 32bit: (MSW,LSW) or (LSB3,LSB2,LSB1,LSB0) or (MSB0,MSB1,MSB2,MSB3)
#  define MSB(u16)        (((U8* )&u16)[0])
#  define LSB(u16)        (((U8* )&u16)[1])
#  define MSW(u32)        (((U16*)&u32)[0])
#  define LSW(u32)        (((U16*)&u32)[1])
#  define MSB0(u32)       (((U8* )&u32)[0])
#  define MSB1(u32)       (((U8* )&u32)[1])
#  define MSB2(u32)       (((U8* )&u32)[2])
#  define MSB3(u32)       (((U8* )&u32)[3])
#  define LSB0(u32)       MSB3(u32)
#  define LSB1(u32)       MSB2(u32)
#  define LSB2(u32)       MSB1(u32)
#  define LSB3(u32)       MSB0(u32)
#endif

// Endian converters
#define Le16(b)                        \
   (  ((U16)(     (b) &   0xFF) << 8)  \
   |  (     ((U16)(b) & 0xFF00) >> 8)  \
   )
#define Le32(b)                             \
   (  ((U32)(     (b) &       0xFF) << 24)  \
   |  ((U32)((U16)(b) &     0xFF00) <<  8)  \
   |  (     ((U32)(b) &   0xFF0000) >>  8)  \
   |  (     ((U32)(b) & 0xFF000000) >> 24)  \
   )

// host to network conversion: used for Intel HEX format, TCP/IP, ...
// Convert a 16-bit value from host-byte order to network-byte order
// Standard Unix, POSIX 1003.1g (draft)

#ifdef LITTLE_ENDIAN
#  define htons(a)    Le16(a)
#define ntohs(a)    htons(a)
#  define htonl(a)    Le32(a)
#define ntohl(a)    htonl(a)
#else
#define htons(a)    (a)
#define ntohs(a)    (a)
#define htonl(a)    (a)
#define ntohl(a)    (a)
#endif

// Constants
#define ENABLE   1
#define ENABLED  1
#define DISABLED 0
#define DISABLE  0
#define FALSE   (0==1)
#define TRUE    (1==1)
#define true    TRUE
#define false   FALSE

#define KO      0
#define OK      1
#define OFF     0
#define ON      1
#ifndef NULL
#define NULL    0
#endif
#ifndef ASM_INCLUDE // define ASM_INCLUDE in your a51 source code before include of .h file
#define CLR     0
#define SET     1
#endif

/* Bit and bytes manipulations */
#define LOW(U16)                ((Uchar)U16)
#define HIGH(U16)               ((Uchar)(U16>>8))
#define TST_BIT_X(addrx,mask)   (*addrx & mask)
#define SET_BIT_X(addrx,mask)   (*addrx = (*addrx | mask))
#define CLR_BIT_X(addrx,mask)   (*addrx = (*addrx & ~mask))
#define OUT_X(addrx,value)      (*addrx = value)
#define IN_X(addrx)             (*addrx)

#  define Max(a, b)            ( (a)>(b) ? (a) : (b) )       // Take the max between a and b
#  define Min(a, b)            ( (a)<(b) ? (a) : (b) )       // Take the min between a and b

// Align on the upper value <val> on a <n> boundary
// i.e. Upper(0, 4)= 4
//      Upper(1, 4)= 4
//      Upper(2, 4)= 4
//      Upper(3, 4)= 4
//      Upper(4, 4)= 8
//      ../..
#  define Upper(val, n)        ( ((val)+(n)) & ~((n)-1) )

// Align up <val> on a <n> boundary
// i.e. Align_up(0, 4)= 0
//      Align_up(1, 4)= 4
//      Align_up(2, 4)= 4
//      Align_up(3, 4)= 4
//      Align_up(4, 4)= 4
//      ../..
#  define Align_up(val, n)     ( ((val)+(n)-1) & ~((n)-1) )

// Align down <val> on a <n> boundary
// i.e. Align_down(0, 4)= 0
//      Align_down(1, 4)= 0
//      Align_down(2, 4)= 0
//      Align_down(3, 4)= 0
//      Align_down(4, 4)= 4
//      ../..
#  define Align_down(val, n)   (  (val)        & ~((n)-1) )

/*M**************************************************************************
* NAME: Long_call
*----------------------------------------------------------------------------
* PARAMS:
* addr: address of the routine to call
*----------------------------------------------------------------------------
* PURPOSE:
* Call the routine at address addr: generate an Assembly LCALL addr opcode.
*----------------------------------------------------------------------------
* EXAMPLE:
* Long_call(0); // Software reset (if no IT used before)
*----------------------------------------------------------------------------
* NOTE:
* May be used as a long jump opcode in some special cases
*****************************************************************************/
#define Long_call(addr)         ((*(void (_ConstType_*)(void))(addr))())

/* {For Langdoc} */

/***********************************************************
 SET_SFR_BIT macro
  parameters
    sfr_reg : defined value in include file for sfr register
    bit_pos : defined value B_XX in include file for particular
              bit of sfr register
    bit_val : CLR / SET
************************************************************/
#define SET_SFR_BIT(sfr_reg, bit_pos, bit_val) { sfr_reg &= ~(1<<(bit_pos)); sfr_reg |= ((bit_val)<<(bit_pos));}

/***********************************************************
 bit_is_clear macro
  parameters
    PORT     : defined value in include file for sfr register
    POSITION : defined value in include file for particular
              bit of sfr register
  example : if (bit_is_clear(PORTB,PORTB3)) ...
************************************************************/
#define bit_is_clear(PORT,POSITION) ((PORT & (1<<POSITION)) == 0 )

/***********************************************************
 bit_is_set macro
  parameters
    PORT     : defined value in include file for sfr register
    POSITION : defined value in include file for particular
              bit of sfr register
  example : if (bit_is_set(PORTB,PORTB3)) ...
************************************************************/
#define bit_is_set(PORT,POSITION) ((PORT & (1<<POSITION)) != 0 )

#define TID_GUARD(proc) ((__TID__ & 0x7FF0) != ((90 << 8) | ((proc) << 4)))

/******************************************************************************/
/* GCC COMPILER                                                               */
/******************************************************************************/
#ifdef __GNUC__
#define _CONST_TYPE_
#define _ConstType_   __flash
#define _MemType_
#define _GenericType_ __generic
#define code PROGMEM
#define xdata
#define idata
#define data
#define At(x) @ x
#define pdata
#define bdata
#define bit   U8
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#define Enable_interrupt() sei()
#define Disable_interrupt() cli()
#define Get_interrupt_state()       (SREG&0x80)

   #endif
#endif /* _COMPILER_H_ */


text:
var express = require('express');
var router = express.Router();
var location = require('../models/location');

router.use(function(req, res, next) {
	res.header("Access-Control-Allow-Origin", "*");
	res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
	next();
});

router.get('/:id?', function(req, res, next) {
    location.getStates(function(err, rows) {
        if(err) {
            res.json(err);
        } else {
            res.json(rows);
        }
    });
});

router.get('/:location?/doctors', function(req, res, next) {
    if(req.params.location) {
        location.getDoctorsByLocation(req.params.location, function(err, rows) {
            if(err) {
                res.json(err);
            } else {
                res.json(rows);
            }
        });
    }
});

module.exports = router;


text:
from django.db import models

# utility class to allow creation of foreign key to instances that are NOT yet saved to the database
# this allow backward compatibility after changes made in django 1.8
class UnsavedForeignKey(models.ForeignKey):

    # a ForeignKey which can point to an unsaved object
    allow_unsaved_instance_assignment = True


text:
date: "2017-08-23T09:00:00+02:00"
title: "Installation avec Docker"
slug: "install-with-docker"
weight: 10
toc: true
draft: false
menu:
  sidebar:
    parent: "installation"
    name: "Docker"
    weight: 10
    identifier: "install-with-docker"
---

# Installation avec Docker

Nous fournissons des images Docker mises à jour automatiquement via le Docker Hub de notre organisation. C'est à vous, lors devotre déploiement, de vous assurez d'utiliser toujours la dernière version stable ou d'utiliser un autre service qui met à jour l'image Docker pour vous.

## Données stockées sur l'hôte

Tout d'abord, vous devez simplement récupérer l'image Docker avec la commande suivante :

```
docker pull gitea/gitea:latest
```

Pour garder vos dépôts et certaines autres données persistantes, vous devez créer un répertoire qui contiendra ces données à l'avenir.

```
sudo mkdir -p /var/lib/gitea
```

Il est temps de démarrer votre instance Docker, c'est un processus assez simple. Vous avez à définir le mappage des ports et le volume à utiliser pour la persistance de vos données :

```
docker run -d --name=gitea -p 10022:22 -p 10080:3000 -v /var/lib/gitea:/data gitea/gitea:latest
```

Vous devriez avoir une instance fonctionnelle de Gitea. Pour accèder à l'interface web, visitez l'adresse http://hostname:10080 avec votre navigateur web préféré. Si vous voulez clôner un dépôt, vous pouvez le faire avec la commande  `git clone ssh://git@hostname:10022/username/repo.git`.

## Named Volumes

Ce guide aboutira à une installation avec les données Gita et PostgreSQL stockées dans des volumes nommés. Cela permet une sauvegarde, une restauration et des mises à niveau en toute simplicité.

### The Database

Création du volume nommé pour la base de données :

```
$ docker volume create --name gitea-db-data
```

Une fois votre volume pret, vous pouvez récupérer l'image Docker de PostgreSQL et créer une instance. Tout comme Gitea, c'est également une image Docker basée sur Alpine Linux, Le montage des données se fera sans aucun problème.

```
$ docker pull postgres:alpine
$ docker run -d --name gitea-db \
    -e POSTGRES_PASSWORD=<PASSWORD> \
    -v gitea-db-data:/var/lib/postgresql/data \
    -p 5432:5432 \
    postgres:alpine
```

Maintenant que la base de données est démarrée, il faut la configurer. N'oubliez pas le mot de passe que vous avez choisi, vous en aurez besoin lors de l'installation de Gitea.

```
$ docker exec -it gitea-db psql -U postgres
psql (9.6.1)
Type "help" for help.

postgres=# CREATE USER gitea WITH PASSWORD '<PASSWORD>';
CREATE ROLE
postgres=# CREATE DATABASE gitea OWNER gitea;
CREATE DATABASE
postgres=# \q
$
```

### Gitea

Premièrement, le volume nommé :

```
$ docker volume create --name gitea-data
```

Puis l'instance de Gitea :

```
$ docker run -d --name gitea \
	--link gitea-db:gitea-db \
	--dns 10.12.10.160 \
	-p 11180:3000 \
	-p 8322:22 \
	-v gitea-data:/data \
	gitea/gitea:latest
```

Vous devriez maintenant avoir deux conteneurs Docker pour Gitea et PostgreSQL plus deux volumes nommés Docker.

# Personnalisation

Les fichier personnalisés ([voir les instructions](https://docs.gitea.io/en-us/customizing-gitea/)) peuvent être placés dans le répertoire `/data/gitea`.

Le fichier de configuration sera sauvegardé à l'emplacement suivant : `/data/gitea/conf/app.ini`

## Il manque quelque chose ?

Est-ce que nous avons oublié quelque chose sur cette page ? N'hésitez pas à nous contacter sur notre [serveur Discord](https://discord.gg/NsatcWJ), vous obtiendrez des réponses à toute vos questions assez rapidement.


text:
using base::StringPiece;

namespace net {

QuicPacketGenerator::QuicPacketGenerator(DelegateInterface* delegate,
                                         QuicPacketCreator* creator)
    : delegate_(delegate),
      packet_creator_(creator),
      should_flush_(true),
      should_send_ack_(false),
      should_send_feedback_(false) {
}

QuicPacketGenerator::~QuicPacketGenerator() {
  for (QuicFrames::iterator it = queued_control_frames_.begin();
       it != queued_control_frames_.end(); ++it) {
    switch (it->type) {
      case PADDING_FRAME:
        delete it->padding_frame;
        break;
      case STREAM_FRAME:
        delete it->stream_frame;
        break;
      case ACK_FRAME:
        delete it->ack_frame;
        break;
      case CONGESTION_FEEDBACK_FRAME:
        delete it->congestion_feedback_frame;
        break;
      case RST_STREAM_FRAME:
        delete it->rst_stream_frame;
        break;
      case CONNECTION_CLOSE_FRAME:
        delete it->connection_close_frame;
        break;
      case GOAWAY_FRAME:
        delete it->goaway_frame;
        break;
      case NUM_FRAME_TYPES:
        DCHECK(false) << "Cannot delete type: " << it->type;
    }
  }
}

void QuicPacketGenerator::SetShouldSendAck(bool also_send_feedback) {
  should_send_ack_ = true;
  should_send_feedback_ = also_send_feedback;
  SendQueuedFrames();
}

void QuicPacketGenerator::AddControlFrame(const QuicFrame& frame) {
  queued_control_frames_.push_back(frame);
  SendQueuedFrames();
}

QuicConsumedData QuicPacketGenerator::ConsumeData(QuicStreamId id,
                                                  StringPiece data,
                                                  QuicStreamOffset offset,
                                                  bool fin) {
  SendQueuedFrames();

  size_t total_bytes_consumed = 0;
  bool fin_consumed = false;

  while (delegate_->CanWrite(NOT_RETRANSMISSION, HAS_RETRANSMITTABLE_DATA)) {
    QuicFrame frame;
    size_t bytes_consumed = packet_creator_->CreateStreamFrame(
        id, data, offset + total_bytes_consumed, fin, &frame);
    bool success = packet_creator_->AddSavedFrame(frame);
    DCHECK(success);

    total_bytes_consumed += bytes_consumed;
    fin_consumed = fin && bytes_consumed == data.size();
    data.remove_prefix(bytes_consumed);
    DCHECK(data.empty() || packet_creator_->BytesFree() == 0u);

    // TODO(ianswett): Restore packet reordering.
    if (should_flush_ || !packet_creator_->HasRoomForStreamFrame()) {
      SerializeAndSendPacket();
    }

    if (data.empty()) {
      // We're done writing the data. Exit the loop.
      // We don't make this a precondition because we could have 0 bytes of data
      // if we're simply writing a fin.
      break;
    }
  }

  // Ensure the FEC group is closed at the end of this method unless other
  // writes are pending.
  if (should_flush_ && packet_creator_->ShouldSendFec(true)) {
    SerializedPacket serialized_fec = packet_creator_->SerializeFec();
    DCHECK(serialized_fec.packet);
    delegate_->OnSerializedPacket(serialized_fec);
  }

  DCHECK(!should_flush_ || !packet_creator_->HasPendingFrames());
  return QuicConsumedData(total_bytes_consumed, fin_consumed);
}

void QuicPacketGenerator::SendQueuedFrames() {
  packet_creator_->MaybeStartFEC();
  while (HasPendingFrames() && delegate_->CanWrite(NOT_RETRANSMISSION,
             packet_creator_->HasPendingFrames() ?
                 HAS_RETRANSMITTABLE_DATA : NO_RETRANSMITTABLE_DATA)) {
    if (!AddNextPendingFrame()) {
      // Packet was full, so serialize and send it.
      SerializeAndSendPacket();
    }
  }

  if (should_flush_) {
    if (packet_creator_->HasPendingFrames()) {
      SerializeAndSendPacket();
    }

    // Ensure the FEC group is closed at the end of this method unless other
    // writes are pending.
    if (packet_creator_->ShouldSendFec(true)) {
      SerializedPacket serialized_fec = packet_creator_->SerializeFec();
      DCHECK(serialized_fec.packet);
      delegate_->OnSerializedPacket(serialized_fec);
      packet_creator_->MaybeStartFEC();
    }
  }
}

void QuicPacketGenerator::StartBatchOperations() {
  should_flush_ = false;
}

void QuicPacketGenerator::FinishBatchOperations() {
  should_flush_ = true;
  SendQueuedFrames();
}

bool QuicPacketGenerator::HasQueuedFrames() const {
  return packet_creator_->HasPendingFrames() || HasPendingFrames();
}

bool QuicPacketGenerator::HasPendingFrames() const {
  return should_send_ack_ || should_send_feedback_ ||
      !queued_control_frames_.empty();
}

bool QuicPacketGenerator::AddNextPendingFrame() {
  if (should_send_ack_) {
    pending_ack_frame_.reset(delegate_->CreateAckFrame());
    if (!packet_creator_->AddSavedFrame(QuicFrame(pending_ack_frame_.get()))) {
      // packet was full
      return false;
    }
    should_send_ack_ = false;
    return true;
  }

  if (should_send_feedback_) {
    pending_feedback_frame_.reset(delegate_->CreateFeedbackFrame());
    if (!packet_creator_->AddSavedFrame(QuicFrame(
            pending_feedback_frame_.get()))) {
      // packet was full
      return false;
    }
    should_send_feedback_ = false;
    return true;
  }

  DCHECK(!queued_control_frames_.empty());
  if (!packet_creator_->AddSavedFrame(queued_control_frames_.back())) {
    // packet was full
    return false;
  }
  queued_control_frames_.pop_back();
  return true;
}

void QuicPacketGenerator::SerializeAndSendPacket() {
  SerializedPacket serialized_packet = packet_creator_->SerializePacket();
  DCHECK(serialized_packet.packet);
  delegate_->OnSerializedPacket(serialized_packet);

  if (packet_creator_->ShouldSendFec(false)) {
    SerializedPacket serialized_fec = packet_creator_->SerializeFec();
    DCHECK(serialized_fec.packet);
    delegate_->OnSerializedPacket(serialized_fec);
    packet_creator_->MaybeStartFEC();
  }
}

}  // namespace net


text:
from __future__ import unicode_literals

from django.db import migrations, models

class Migration(migrations.Migration):

    dependencies = [
        ('consent', '0006_fieldorder'),
    ]

    operations = [
        migrations.AddField(
            model_name='userdatafields',
            name='default_position',
            field=models.IntegerField(default=0),
        ),
    ]


text:
cask 'sublime-text' do
  version '3126'
  sha256 '2bbd357cd29303b05770ef479e2f86ea8166ac43062ae9e84dc07abfd0ce2c96'

  url "https://download.sublimetext.com/Sublime%20Text%20Build%20#{version}.dmg"
  appcast 'https://www.sublimetext.com/updates/3/stable/appcast_osx.xml',
          checkpoint: '34717c4ad8bc4fd51b211effcc67fb84a04acff65126a77ba9789811659cb6d6'
  name 'Sublime Text'
  homepage 'https://www.sublimetext.com/3'

  auto_updates true
  conflicts_with cask: 'caskroom/versions/sublime-text-dev'

  app 'Sublime Text.app'
  binary "#{appdir}/Sublime Text.app/Contents/SharedSupport/bin/subl"

  uninstall quit: 'com.sublimetext.3'

  zap delete: [
                '~/Library/Application Support/com.apple.sharedfilelist/com.apple.LSSharedFileList.ApplicationRecentDocuments/com.sublimetext.3.sfl',
                '~/Library/Application Support/Sublime Text 3',
                '~/Library/Caches/com.sublimetext.3',
                '~/Library/Preferences/com.sublimetext.3.plist',
                '~/Library/Saved Application State/com.sublimetext.3.savedState',
              ]
end


text: module.exports = require('./lib/doxco.js');