text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#EEEEEE"
    android:fitsSystemWindows="false"
    tools:context=".view.MainActivity">

    <ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="match_parent"
                android:layout_height="match_parent"

                android:fillViewport="true">

        <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
                        xmlns:app="http://schemas.android.com/apk/res-auto"
                        android:id="@+id/container"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginBottom="@dimen/activity_vertical_margin"
                        android:layout_marginLeft="@dimen/activity_horizontal_margin"
                        android:layout_marginRight="@dimen/activity_horizontal_margin"
                        android:layout_marginTop="@dimen/activity_vertical_margin"
            >

            <android.support.v7.widget.CardView
                android:id="@+id/logo_card"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerVertical="false"
                android:layout_gravity="center_horizontal|center_vertical"
                android:layout_margin="7dp"
                app:cardCornerRadius="3dp">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#5F0F40"
                    >

                    <TextView
                        android:id="@+id/dots"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_alignParentRight="true"
                        android:layout_alignParentTop="true"
                        android:layout_gravity="top|right"
                        android:layout_marginRight="20dp"
                        android:text="..."
                        android:textColor="#FFFFFF"
                        android:textSize="30dp"
                        android:textStyle="bold"/>

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:padding="20dp">

                        <ImageView
                            android:id="@+id/img_wireless"
                            android:layout_width="wrap_content"
                            android:layout_height="200dp"
                            android:layout_centerHorizontal="true"
                            android:layout_gravity="center_horizontal|top"
                            android:src="@mipmap/logo"/>

                        <RelativeLayout
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_below="@+id/img_wireless"
                            android:layout_centerHorizontal="true">

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="30dp"
                                android:layout_alignParentLeft="true"
                                android:layout_centerVertical="true"
                                android:layout_marginLeft="5dp">

                                <com.wang.avi.AVLoadingIndicatorView
                                    android:id="@+id/connection_logo_loading"
                                    android:layout_width="wrap_content"
                                    android:layout_height="30dp"
                                    android:layout_centerVertical="true"
                                    android:alpha="0"
                                    android:visibility="gone"
                                    app:indicatorName="LineScaleIndicator"
                                    />

                                <ImageView
                                    android:id="@+id/connection_logo_connected"
                                    android:layout_width="30dp"
                                    android:layout_height="30dp"
                                    android:layout_alignParentLeft="true"
                                    android:alpha="0"
                                    android:src="@mipmap/connected"
                                    android:visibility="gone"/>

                                <ImageView
                                    android:id="@+id/connection_logo_disconnected"
                                    android:layout_width="30dp"
                                    android:layout_height="30dp"
                                    android:layout_alignParentLeft="true"
                                    android:alpha="0"
                                    android:src="@mipmap/not_connected"
                                    android:visibility="gone"/>

                            </LinearLayout>

                            <com.andexert.library.RippleView
                                android:id="@+id/enableButtonWrapper"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentEnd="true"
                                android:layout_gravity="right">

                                <Button
                                    android:id="@+id/button"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:backgroundTint="#321325"
                                    android:text="START"
                                    android:textColor="@android:color/white"
                                    android:textSize="16dp"
                                    android:textStyle="normal">

                                    <requestFocus/>
                                </Button>
                            </com.andexert.library.RippleView>
                        </RelativeLayout>
                    </RelativeLayout>
                </RelativeLayout>
            </android.support.v7.widget.CardView>

            <android.support.v7.widget.CardView
                android:id="@+id/error_card"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/logo_card"
                android:layout_centerVertical="false"
                android:layout_gravity="center_horizontal|center_vertical"
                android:layout_margin="7dp"
                android:layout_marginTop="20dp"
                android:visibility="gone"
                app:cardCornerRadius="3dp">

                <RelativeLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:background="#5F0F40"
                    android:padding="20dp"
                    >

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

                        <ImageView
                            android:layout_width="50dp"
                            android:layout_height="50dp"

                            android:layout_gravity="center"
                            android:src="@mipmap/ic_error_outline_white_48dp"
                            />

                        <TextView
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_gravity="center"
                            android:layout_marginLeft="20dp"
                            android:text="Server can not be reached"
                            android:textAppearance="?android:attr/textAppearanceMedium"
                            android:textColor="@android:color/white"/>

                    </LinearLayout>

                </RelativeLayout>
            </android.support.v7.widget.CardView>

            <LinearLayout
                android:id="@+id/settings"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_below="@id/error_card"
                android:orientation="vertical">

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left|top"
                    android:layout_marginLeft="7dp"
                    android:layout_marginTop="7dp"
                    android:paddingLeft="10dp"
                    android:text="Settings"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textColor="@android:color/black"/>

                <android.support.v7.widget.CardView
                    android:id="@+id/settings_card"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_horizontal"
                    android:layout_margin="7dp"
                    app:cardCornerRadius="3dp">

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="#FFFFFF"
                        android:padding="20dp">

                        <TextView
                            android:id="@+id/server_title"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="0dp"
                            android:gravity="top|left"
                            android:text="Select channel to join"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>

                        <LinearLayout
                            android:id="@+id/serverTextEditGroup"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/server_title"
                            android:orientation="vertical">

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

                                <ImageView
                                    android:layout_width="30dp"
                                    android:layout_height="30dp"
                                    android:layout_gravity="center"
                                    android:src="@mipmap/ic_developer_board_black_24dp"
                                    />

                                <EditText
                                    android:id="@+id/serveradress"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:layout_below="@id/server_title"
                                    android:layout_gravity="center_horizontal|center_vertical"
                                    android:layout_marginLeft="8dp"
                                    android:hint="Server adress"
                                    android:maxLines="1"
                                    android:singleLine="true"/>

                            </LinearLayout>

                            <TextView
                                android:id="@+id/address_validation"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_below="@id/serverTextEditGroup"
                                android:layout_marginLeft="30dp"
                                android:paddingLeft="10dp"
                                android:text="Server not available"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:textColor="#5F0F40"
                                android:textStyle="italic"
                                android:visibility="gone"
                                />

                            <LinearLayout
                                android:id="@+id/channelTextEditContainer"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_below="@id/address_validation"
                                android:layout_marginTop="10dp"
                                android:orientation="horizontal"
                                >

                                <ImageView
                                    android:layout_width="30dp"
                                    android:layout_height="30dp"
                                    android:layout_gravity="center"
                                    android:src="@mipmap/ic_group_black_24dp"
                                    />

                                <EditText
                                    android:id="@+id/channel"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:layout_gravity="center_horizontal|center_vertical"
                                    android:layout_marginLeft="8dp"
                                    android:hint="Channel"
                                    android:maxLines="1"
                                    android:singleLine="true"/>

                            </LinearLayout>

                            <TextView
                                android:id="@+id/channel_validation"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_below="@id/channelTextEditContainer"
                                android:layout_marginLeft="30dp"
                                android:paddingLeft="10dp"
                                android:text="No valid channel"
                                android:textAppearance="?android:attr/textAppearanceSmall"
                                android:textColor="#5F0F40"
                                android:textStyle="italic"
                                android:visibility="gone"
                                />

                            <View
                                android:id="@+id/sep9"
                                android:layout_width="fill_parent"
                                android:layout_height="1dip"
                                android:layout_marginTop="15dp"
                                android:background="#11000000"/>

                            <FrameLayout
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_marginTop="15dp">

                                <LinearLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:gravity="left"
                                    android:orientation="horizontal"
                                    >

                                    <ImageView
                                        android:layout_width="30dp"
                                        android:layout_height="30dp"
                                        android:layout_gravity="center"
                                        android:src="@mipmap/ic_developer_board_black_24dp"
                                        />

                                    <TextView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="center"
                                        android:layout_marginLeft="9dp"
                                        android:text="Start on Boot"
                                        android:textAppearance="?android:attr/textAppearanceMedium"
                                        android:textColor="@android:color/black"/>

                                </LinearLayout>

                                <Switch
                                    android:id="@+id/start_on_boot_swtich"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentRight="true"
                                    android:layout_gravity="right"
                                    android:checked="false"
                                    android:gravity="right"/>
                            </FrameLayout>
                        </LinearLayout>

                    </RelativeLayout>
                </android.support.v7.widget.CardView>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left|top"
                    android:layout_marginLeft="7dp"
                    android:layout_marginTop="7dp"
                    android:paddingLeft="10dp"
                    android:text="Feedback channel"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textColor="@android:color/black"/>

                <android.support.v7.widget.CardView
                    android:id="@+id/feedback_channel"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="7dp"
                    app:cardCornerRadius="3dp">

                    <RelativeLayout
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:background="#FFFFFF"
                        android:paddingBottom="15dp"
                        android:paddingLeft="20dp"
                        android:paddingRight="20dp"
                        android:paddingTop="20dp">

                        <TextView
                            android:id="@+id/choose_service_text"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginBottom="8dp"
                            android:gravity="top|left"
                            android:text="Choose feedback channels"
                            android:textAppearance="?android:attr/textAppearanceSmall"/>

                        <!--<TextView-->
                        <!--android:id="@+id/choose_service_text"-->
                        <!--android:layout_width="wrap_content"-->
                        <!--android:layout_height="wrap_content"-->
                        <!--android:text="Choose feedback type"-->
                        <!--android:textAppearance="?android:attr/textAppearanceMedium"-->
                        <!--android:textColor="@android:color/black"/>-->

                        <LinearLayout
                            android:id="@+id/choose_feedback"
                            android:layout_width="wrap_content"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/choose_service_text"
                            android:layout_marginBottom="5dp"
                            android:orientation="horizontal">

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginRight="20dp"
                                android:orientation="vertical"
                                >

                                <com.andexert.library.RippleView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"

                                    >

                                    <Button
                                        android:id="@+id/led_feedback"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:backgroundTint="#321325"
                                        android:text="LED"
                                        android:textColor="@android:color/white"
                                        android:textSize="16dp"
                                        android:textStyle="normal"/>
                                </com.andexert.library.RippleView>

                                <View
                                    android:id="@+id/feedback_channel_selection_led"
                                    android:layout_width="fill_parent"
                                    android:layout_height="2dip"
                                    android:layout_marginTop="2dp"
                                    android:background="#5F0F40"/>
                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_marginRight="20dp"
                                android:orientation="vertical"
                                >

                                <com.andexert.library.RippleView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    >

                                    <Button
                                        android:id="@+id/flash_feedback"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:backgroundTint="#321325"
                                        android:text="FLASH"
                                        android:textColor="@android:color/white"
                                        android:textSize="16dp"
                                        android:textStyle="normal"/>
                                </com.andexert.library.RippleView>

                                <View
                                    android:id="@+id/feedback_channel_selection_flash"
                                    android:layout_width="fill_parent"
                                    android:layout_height="2dip"
                                    android:layout_marginTop="2dp"
                                    android:background="#5F0F40"/>

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:orientation="vertical"
                                >

                                <com.andexert.library.RippleView
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    >

                                    <Button
                                        android:id="@+id/vibra_feedback"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:backgroundTint="#321325"
                                        android:text="VIBRA"
                                        android:textColor="@android:color/white"
                                        android:textSize="16dp"
                                        android:textStyle="normal"/>
                                </com.andexert.library.RippleView>

                                <View
                                    android:id="@+id/feedback_channel_selection_vibra"
                                    android:layout_width="fill_parent"
                                    android:layout_height="2dip"
                                    android:layout_marginTop="2dp"
                                    android:background="#5F0F40"/>
                            </LinearLayout>
                        </LinearLayout>

                        <TextView
                            android:id="@+id/feedback_channel_validation"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/choose_feedback"
                            android:layout_marginLeft="0dp"
                            android:layout_marginTop="1dp"
                            android:paddingLeft="0dp"
                            android:text="No feedback channel selected"
                            android:textAppearance="?android:attr/textAppearanceSmall"
                            android:textColor="#5F0F40"
                            android:textStyle="italic"
                            android:visibility="visible"
                            />

                        <View
                            android:id="@+id/sep2"
                            android:layout_width="fill_parent"
                            android:layout_height="1dip"
                            android:layout_below="@id/feedback_channel_validation"
                            android:layout_marginTop="10dp"
                            android:background="#11000000"/>

                        <LinearLayout
                            android:id="@+id/led_hint"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_below="@id/sep2"
                            android:layout_marginTop="10dp"
                            android:orientation="horizontal">

                            <ImageView
                                android:id="@+id/lightbulp"
                                android:layout_width="35dp"
                                android:layout_height="wrap_content"
                                android:layout_gravity="left"
                                android:layout_marginLeft="0dp"
                                android:backgroundTintMode="add"
                                android:src="@mipmap/lightbulb"
                                />

                            <TextView
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_gravity="center_vertical"
                                android:layout_marginLeft="5dp"
                                android:text="Some devices only flash the notification LED if the screen is off."
                                android:textAppearance="?android:attr/textAppearanceSmall"/>

                        </LinearLayout>

                    </RelativeLayout>
                </android.support.v7.widget.CardView>

                <RelativeLayout
                    android:id="@+id/settings_container"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content">

                    <TextView
                        android:id="@+id/feedback_settings_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:layout_gravity="left|top"
                        android:layout_marginLeft="7dp"
                        android:layout_marginTop="7dp"
                        android:paddingLeft="10dp"
                        android:text="Feedback settings"
                        android:textAppearance="?android:attr/textAppearanceMedium"
                        android:textColor="@android:color/black"/>

                    <android.support.v7.widget.CardView
                        android:id="@+id/led_card"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_below="@id/feedback_settings_title"
                        android:layout_margin="7dp"
                        app:cardCornerRadius="3dp">

                        <RelativeLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:background="#FFFFFF"
                            android:paddingBottom="15dp"
                            android:paddingLeft="20dp"
                            android:paddingRight="20dp"
                            android:paddingTop="20dp">

                            <FrameLayout
                                android:id="@+id/tryout"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"

                                >

                                <TextView
                                    android:id="@+id/tryOutText"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_gravity="left|top"
                                    android:text="Give it a shot"
                                    android:textAppearance="?android:attr/textAppearanceMedium"
                                    android:textColor="@android:color/black"/>

                                <TextView
                                    android:id="@+id/text"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_gravity="left|center"
                                    android:layout_marginTop="10dp"
                                    android:text="Show example feedback"
                                    android:textAppearance="?android:attr/textAppearanceSmall"/>

                                <com.andexert.library.RippleView
                                    android:id="@+id/tryoutButtonWrapper"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_alignParentBottom="true"
                                    android:layout_alignParentEnd="true"
                                    android:layout_gravity="right|center_vertical">

                                    <Button
                                        android:id="@+id/tryoutButton"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:backgroundTint="#321325"
                                        android:text="TRY"
                                        android:textColor="@android:color/white"
                                        android:textSize="16dp"
                                        android:textStyle="normal"/>
                                </com.andexert.library.RippleView>

                            </FrameLayout>

                            <RelativeLayout
                                android:id="@+id/advanced_options_led"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_below="@id/tryout"
                                android:visibility="gone">

                                <View
                                    android:id="@+id/sep6"
                                    android:layout_width="fill_parent"
                                    android:layout_height="1dip"
                                    android:layout_marginTop="10dp"
                                    android:background="#11000000"/>

                                <FrameLayout
                                    android:id="@+id/choose_color"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:layout_below="@id/sep6"
                                    android:layout_marginTop="10dp"
                                    >

                                    <LinearLayout
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="left|top"
                                        android:orientation="horizontal">

                                        <TextView
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="Choose LED "
                                            android:textAppearance="?android:attr/textAppearanceMedium"
                                            android:textColor="@android:color/black"/>

                                        <TextView
                                            android:id="@+id/led_color_text"
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:text="color"
                                            android:textAppearance="?android:attr/textAppearanceMedium"
                                            android:textColor="@android:color/holo_red_dark"/>

                                    </LinearLayout>

                                    <TextView
                                        android:id="@+id/choose_color_detail"
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content"
                                        android:layout_gravity="left|bottom"
                                        android:layout_marginTop="25dp"
                                        android:text="Availability is device dependent"
                                        android:textAppearance="?android:attr/textAppearanceSmall"/>

                                </FrameLayout>

                                <LinearLayout
                                    android:id="@+id/led_choose"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:layout_below="@id/choose_color"
                                    android:layout_gravity="center_horizontal|bottom"
                                    android:layout_marginTop="10dp"
                                    android:gravity="center"
                                    android:orientation="horizontal">

                                    <com.andexert.library.RippleView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content">

                                        <android.support.design.widget.FloatingActionButton
                                            android:id="@+id/led_red"
                                            android:layout_width="50dp"
                                            android:layout_height="wrap_content"
                                            android:layout_margin="10dp"
                                            app:backgroundTint="@android:color/holo_red_dark"
                                            />

                                    </com.andexert.library.RippleView>

                                    <com.andexert.library.RippleView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content">

                                        <android.support.design.widget.FloatingActionButton
                                            android:id="@+id/led_blue"
                                            android:layout_width="50dp"
                                            android:layout_height="wrap_content"
                                            android:layout_margin="10dp"
                                            app:backgroundTint="@android:color/holo_blue_dark"
                                            />

                                    </com.andexert.library.RippleView>

                                    <com.andexert.library.RippleView
                                        android:layout_width="wrap_content"
                                        android:layout_height="wrap_content">

                                        <android.support.design.widget.FloatingActionButton
                                            android:id="@+id/led_green"
                                            android:layout_width="50dp"
                                            android:layout_height="wrap_content"
                                            android:layout_margin="10dp"
                                            app:backgroundTint="@android:color/holo_green_dark"
                                            />

                                    </com.andexert.library.RippleView>
                                </LinearLayout>

                                <RelativeLayout
                                    android:id="@+id/led_root_options"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:layout_below="@id/led_choose">

                                    <View
                                        android:id="@+id/sep5"
                                        android:layout_width="fill_parent"
                                        android:layout_height="1dip"
                                        android:layout_marginTop="10dp"
                                        android:background="#11000000"/>

                                    <FrameLayout
                                        android:id="@+id/kernel_hack"
                                        android:layout_width="match_parent"
                                        android:layout_height="50dp"
                                        android:layout_below="@id/sep5"
                                        android:layout_marginTop="15dp">

                                        <TextView
                                            android:id="@+id/textView422"
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:layout_gravity="left|top"
                                            android:text="LED hack (root)"
                                            android:textAppearance="?android:attr/textAppearanceMedium"
                                            android:textColor="@android:color/black"/>

                                        <TextView
                                            android:id="@+id/textView5"
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:layout_alignParentStart="true"
                                            android:layout_below="@+id/textView422"
                                            android:layout_gravity="left|center_vertical"
                                            android:layout_marginTop="10dp"
                                            android:text="Use kernel LED trigger"
                                            android:textAppearance="?android:attr/textAppearanceSmall"/>

                                        <Switch
                                            android:id="@+id/led_kernel_hack"
                                            android:layout_width="wrap_content"
                                            android:layout_height="wrap_content"
                                            android:layout_alignParentBottom="true"
                                            android:layout_alignParentEnd="true"
                                            android:layout_alignParentTop="true"
                                            android:layout_gravity="right|center_vertical"
                                            android:checked="false"/>

                                    </FrameLayout>
                                </RelativeLayout>
                            </RelativeLayout>

                            <View
                                android:id="@+id/sep3"
                                android:layout_width="fill_parent"
                                android:layout_height="1dip"
                                android:layout_below="@id/advanced_options_led"
                                android:layout_marginTop="10dp"
                                android:background="#11000000"/>

                            <TextView
                                android:id="@+id/button_show_advanced_led"
                                android:layout_width="match_parent"
                                android:layout_height="wrap_content"
                                android:layout_below="@id/sep3"
                                android:layout_marginRight="5dp"
                                android:layout_marginTop="13dp"
                                android:gravity="right"
                                android:text="ADVANCED"
                                android:textColor="#5F0F40"
                                android:textSize="16dp"
                                android:textStyle="bold"/>

                        </RelativeLayout>

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

                </RelativeLayout>

                <TextView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="left|top"
                    android:layout_marginLeft="7dp"
                    android:layout_marginTop="7dp"
                    android:paddingLeft="10dp"
                    android:text="History"
                    android:textAppearance="?android:attr/textAppearanceMedium"
                    android:textColor="@android:color/black"/>

                <android.support.v7.widget.CardView
                    android:id="@+id/history_card"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_margin="7dp"
                    app:cardCornerRadius="3dp">

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

                        <TextView
                            android:layout_width="30dp"
                            android:layout_height="30dp"
                            android:layout_alignParentTop="true"
                            android:background="@color/colorAccent"
                            android:text="..."/>

                        <RelativeLayout
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:background="#FFFFFF"
                            android:paddingBottom="15dp"
                            android:paddingLeft="20dp"
                            android:paddingRight="20dp"
                            android:paddingTop="20dp">

                            <RelativeLayout
                                android:id="@+id/history_recycleview_container"
                                android:layout_width="match_parent"
                                android:layout_height="150dp">

                                <android.support.v7.widget.RecyclerView
                                    android:id="@+id/history_recycleview"
                                    android:layout_width="match_parent"
                                    android:layout_height="wrap_content"
                                    android:layout_centerInParent="true"
                                    android:layout_margin="0dp"
                                    android:orientation="vertical"
                                    android:padding="0dp"
                                    android:scrollbars="none"
                                    />

                            </RelativeLayout>

                            <View
                                android:id="@+id/sep4"
                                android:layout_width="fill_parent"
                                android:layout_height="1dip"
                                android:layout_below="@id/history_recycleview_container"
                                android:layout_marginTop="10dp"
                                android:background="#11000000"/>

                            <LinearLayout
                                android:id="@+id/history_group"
                                android:layout_width="wrap_content"
                                android:layout_height="wrap_content"
                                android:layout_alignParentBottom="true"
                                android:layout_alignParentEnd="true"
                                android:layout_below="@id/sep4"
                                android:layout_marginTop="13dp"
                                android:gravity="right"
                                android:orientation="horizontal"
                                >

                                <TextView
                                    android:id="@+id/clearHistoryButton"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginRight="40dp"
                                    android:text="CLEAR"
                                    android:textColor="#5F0F40"
                                    android:textSize="16dp"
                                    android:textStyle="bold"/>

                                <TextView
                                    android:id="@+id/moreHistoryButton"
                                    android:layout_width="wrap_content"
                                    android:layout_height="wrap_content"
                                    android:layout_marginRight="5dp"
                                    android:text="MORE"
                                    android:textColor="#5F0F40"
                                    android:textSize="16dp"
                                    android:textStyle="bold"/>
                            </LinearLayout>

                        </RelativeLayout>
                    </RelativeLayout>

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

                <View
                    android:layout_width="match_parent"
                    android:layout_height="30dp"></View>

            </LinearLayout>
        </RelativeLayout>
    </ScrollView>

</RelativeLayout>


text:
package structmask

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// StructMask selects a subset of a google.protobuf.Struct.
//
// Usually used as a repeated field, to allow specifying a union of different
// subsets.
type StructMask struct {
	state         protoimpl.MessageState
	sizeCache     protoimpl.SizeCache
	unknownFields protoimpl.UnknownFields

	// A field path inside the struct to select.
	//
	// Each item can be:
	//   * `some_value` - a concrete dict key to follow (unless it is a number or
	//     includes `*`, use quotes in this case).
	//   * `"some_value"` - same, but quoted. Useful for selecting `*` or numbers
	//     literally. See https://pkg.go.dev/strconv#Unquote for syntax.
	//   * `<number>` (e.g. `0`) - a zero-based list index to follow.
	//     **Not implemented**.
	//   *  `*` - follow all dict keys and all list elements. Applies **only** to
	//     dicts and lists. Trying to recurse into a number or a string results
	//     in an empty match.
	//
	// When examining a value the following exceptional conditions result in
	// an empty match, which is represented by `null` for list elements or
	// omissions of the field for dicts:
	//   * Trying to follow a dict key while examining a list.
	//   * Trying to follow a key which is not present in the dict.
	//   * Trying to use `*` mask with values that aren't dicts or lists.
	//
	// When using `*`, the result is always a subset of the input. In particular
	// this is important when filtering lists: if a list of size N is selected by
	// the mask, then the filtered result will also always be a list of size N,
	// with elements filtered further according to the rest of the mask (perhaps
	// resulting in `null` elements on type mismatches, as explained above).
	Path []string `protobuf:"bytes,1,rep,name=path,proto3" json:"path,omitempty"`
}

func (x *StructMask) Reset() {
	*x = StructMask{}
	if protoimpl.UnsafeEnabled {
		mi := &file_go_chromium_org_luci_common_proto_structmask_structmask_proto_msgTypes[0]
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		ms.StoreMessageInfo(mi)
	}
}

func (x *StructMask) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*StructMask) ProtoMessage() {}

func (x *StructMask) ProtoReflect() protoreflect.Message {
	mi := &file_go_chromium_org_luci_common_proto_structmask_structmask_proto_msgTypes[0]
	if protoimpl.UnsafeEnabled && x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use StructMask.ProtoReflect.Descriptor instead.
func (*StructMask) Descriptor() ([]byte, []int) {
	return file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDescGZIP(), []int{0}
}

func (x *StructMask) GetPath() []string {
	if x != nil {
		return x.Path
	}
	return nil
}

var File_go_chromium_org_luci_common_proto_structmask_structmask_proto protoreflect.FileDescriptor

var file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDesc = []byte{
	0x0a, 0x3d, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72,
	0x67, 0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72,
	0x6f, 0x74, 0x6f, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6d, 0x61, 0x73, 0x6b, 0x2f, 0x73,
	0x74, 0x72, 0x75, 0x63, 0x74, 0x6d, 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
	0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6d, 0x61, 0x73, 0x6b, 0x22, 0x20, 0x0a, 0x0a, 0x53,
	0x74, 0x72, 0x75, 0x63, 0x74, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x61, 0x74,
	0x68, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x04, 0x70, 0x61, 0x74, 0x68, 0x42, 0x2e, 0x5a,
	0x2c, 0x67, 0x6f, 0x2e, 0x63, 0x68, 0x72, 0x6f, 0x6d, 0x69, 0x75, 0x6d, 0x2e, 0x6f, 0x72, 0x67,
	0x2f, 0x6c, 0x75, 0x63, 0x69, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x70, 0x72, 0x6f,
	0x74, 0x6f, 0x2f, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x6d, 0x61, 0x73, 0x6b, 0x62, 0x06, 0x70,
	0x72, 0x6f, 0x74, 0x6f, 0x33,
}

var (
	file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDescOnce sync.Once
	file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDescData = file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDesc
)

func file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDescGZIP() []byte {
	file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDescOnce.Do(func() {
		file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDescData = protoimpl.X.CompressGZIP(file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDescData)
	})
	return file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDescData
}

var file_go_chromium_org_luci_common_proto_structmask_structmask_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_go_chromium_org_luci_common_proto_structmask_structmask_proto_goTypes = []interface{}{
	(*StructMask)(nil), // 0: structmask.StructMask
}
var file_go_chromium_org_luci_common_proto_structmask_structmask_proto_depIdxs = []int32{
	0, // [0:0] is the sub-list for method output_type
	0, // [0:0] is the sub-list for method input_type
	0, // [0:0] is the sub-list for extension type_name
	0, // [0:0] is the sub-list for extension extendee
	0, // [0:0] is the sub-list for field type_name
}

func init() { file_go_chromium_org_luci_common_proto_structmask_structmask_proto_init() }
func file_go_chromium_org_luci_common_proto_structmask_structmask_proto_init() {
	if File_go_chromium_org_luci_common_proto_structmask_structmask_proto != nil {
		return
	}
	if !protoimpl.UnsafeEnabled {
		file_go_chromium_org_luci_common_proto_structmask_structmask_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
			switch v := v.(*StructMask); i {
			case 0:
				return &v.state
			case 1:
				return &v.sizeCache
			case 2:
				return &v.unknownFields
			default:
				return nil
			}
		}
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDesc,
			NumEnums:      0,
			NumMessages:   1,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_go_chromium_org_luci_common_proto_structmask_structmask_proto_goTypes,
		DependencyIndexes: file_go_chromium_org_luci_common_proto_structmask_structmask_proto_depIdxs,
		MessageInfos:      file_go_chromium_org_luci_common_proto_structmask_structmask_proto_msgTypes,
	}.Build()
	File_go_chromium_org_luci_common_proto_structmask_structmask_proto = out.File
	file_go_chromium_org_luci_common_proto_structmask_structmask_proto_rawDesc = nil
	file_go_chromium_org_luci_common_proto_structmask_structmask_proto_goTypes = nil
	file_go_chromium_org_luci_common_proto_structmask_structmask_proto_depIdxs = nil
}

redpajama_set_name: RedPajamaGithub


text:
<?php
 //WARNING: The contents of this file are auto-generated
include('custom/metadata/jjwg_maps_jjwg_areasMetaData.php');

?>


text:
package com.example;

@Marker
public class PropertyBean {

    private String name;

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}


text:
   jacman-coll is a part of the JacMan suite, dedicated to collective subscription management

## Version
  0.6

## Synopsis
  Used in specific GUI tools

## More documentation
   See the Yardoc/RDoc documentation.

## Copyright
   (c) 2015, Michel Demazure

## Source
   [![Code Climate](https://codeclimate.com/github/badal/jacman-coll.png)](https://codeclimate.com/github/badal/jacman-coll)

   * Source code on repository [GitHub](https://github.com/badal/jacman-coll)

## License
   See LICENSE

## Author
   Michel Demazure
   firstname at name dot com


text:
import { togglisePasswords } from '../utils/passwordHelper';

$(() => {
  // togglisePasswords({ selector: '#create_account_form' });

  const createAccountForm = $('#create_account_form');

  const addValidationError = (field) => field.addClass('has-error');
  const removeValidationError = (field) => field.removeClass('has-error');

  const validateFormFields = (form) => {
    let anyInvalid = false;
    if (form.length > 0) {
      form.find('input[aria-required="true"]').each((_idx, el) => {
        const field = $(el);

        switch (field.attr('id')) {
        case 'org_index_name': {
          // We need to detemine if the user selected an item from the Org autocomplete
          // or provided a manually entered Org name
          const userEnteredField = form.find('#org_index_user_entered_name');
          const warningBlock = form.find('.autocomplete-warning');

          if (field.val().trim().length > 0 && warningBlock.hasClass('hide')) {
            removeValidationError(field);
          } else if (userEnteredField !== undefined && userEnteredField.val().trim().length > 0) {
            removeValidationError(field);
          } else {
            anyInvalid = true;
            addValidationError(field);
          }
          break;
        }
        case 'new_user_accept_terms': {
          if (!field.prop('checked')) {
            anyInvalid = true;
            addValidationError(field);
          } else {
            removeValidationError(field);
          }
          break;
        }
        default: {
          // All other text fields
          if (field.val().trim().length <= 0) {
            anyInvalid = true;
            addValidationError(field);
          } else {
            removeValidationError(field);
          }
          break;
        }
        }
      });
    }
    return !anyInvalid;
  };

  if (createAccountForm.length > 0) {
    const submit = createAccountForm.find('button[type="submit"]');

    // Perform client side form validation. If any required fields are missing then
    // cancel the form submission
    submit.on('click', (e) => {
      validateFormFields(createAccountForm);
      if (createAccountForm.find('.has-error').length > 0) {
        submit.siblings('.form-error-msg').removeClass('hide');
        e.preventDefault();
      }
    });
  }

  if ($('#sign-in-tab').length > 0) {
    const shibSignInForm = $('#new_org');
    if (shibSignInForm.length > 0) {
      const submit = shibSignInForm.find('button[type="submit"]');

      // Perform client side form validation. If any required fields are missing then
      // cancel the form submission
      submit.on('click', (e) => {
        validateFormFields(shibSignInForm);

        if (shibSignInForm.find('.has-error').length > 0) {
          submit.siblings('.form-error-msg').removeClass('hide');
          e.preventDefault();
        }
      });
    }
  }
});


text:
import React from 'react'
import { Route, Redirect, IndexRoute } from 'react-router'
import RouterContainer from './containers/RouterContainer'
import $ from 'jquery'

/* containers */
import App from './containers/App.js'

/* partials */
import About from './pages/About.js'
import CV from './pages/CV.js'

export default (
  <Route path='/app' component={App}>
    <Route path='about' component={About}/>
    <Route path='cv' component={CV}/>
  </Route>
)

// <IndexRoute component={About}/>
// <Route path='/login' component={Login} onEnter={onEnter}/>
// <Route path='/registration' component={Registration} onEnter={onEnter}/>


text:
namespace ChilliSource
{
	namespace Rendering
	{
        CS_DEFINE_NAMEDTYPE(Cubemap);

        //--------------------------------------------------------------
        //--------------------------------------------------------------
        CubemapUPtr Cubemap::Create()
        {
#if defined(CS_TARGETPLATFORM_ANDROID) || defined(CS_TARGETPLATFORM_IOS) || defined(CS_TARGETPLATFORM_WINDOWS)
            return CubemapUPtr(new CSBackend::OpenGL::Cubemap());
#else
            return nullptr;
#endif
        }
	}
}


text:
package com.wotifgroup.dropwizard.jmx;

import static org.fest.assertions.api.Assertions.*;
import static org.mockito.Matchers.anyObject;
import static org.mockito.Mockito.*;

import java.io.File;
import java.util.Collections;

import com.fasterxml.jackson.databind.ObjectMapper;
import io.dropwizard.configuration.ConfigurationFactory;
import org.junit.Before;
import org.junit.Test;

import com.google.common.base.Optional;
import com.google.common.io.Resources;

import javax.validation.ConstraintViolation;
import javax.validation.Validator;

public class JmxConnectorConfigurationTest {

    private JmxConnectorConfiguration jmx;

    @Before
    public void setUp() throws Exception {
        Validator validator = mock(Validator.class);
        when(validator.validate(anyObject())).thenReturn(Collections.<ConstraintViolation<Object>>emptySet());
        this.jmx = new ConfigurationFactory<JmxConnectorConfiguration>(JmxConnectorConfiguration.class, validator, new ObjectMapper(), "")
                .build(new File(Resources.getResource("yaml/jmx.yml").toURI()));
    }

    @Test
    public void hasARegistryPort() throws Exception {
        assertThat(jmx.getRegistryPort())
                .isEqualTo(9086);
    }

    @Test
    public void hasAServerPort() throws Exception {
        assertThat(jmx.getServerPort())
                .isEqualTo(9087);
    }

    @Test
    public void hasAReadOnlyUsername() throws Exception {
        assertThat(jmx.getReadOnlyUsername())
                .isEqualTo(Optional.of("readonly"));
    }

    @Test
    public void hasAReadOnlyPassword() throws Exception {
        assertThat(jmx.getReadOnlyPassword())
                .isEqualTo(Optional.of("readonlypassword"));
    }

    @Test
    public void hasAReadWriteUsername() throws Exception {
        assertThat(jmx.getReadWriteUsername())
                .isEqualTo(Optional.of("readwrite"));
    }

    @Test
    public void hasAReadWritePassword() throws Exception {
        assertThat(jmx.getReadWritePassword())
                .isEqualTo(Optional.of("readwritepassword"));
    }

    @Test
    public void defaultConfigurationIsValid() {
        JmxConnectorConfiguration config = new JmxConnectorConfiguration();

        assertThat(config.isReadOnlyUsernameDefined()).isTrue();
        assertThat(config.isReadWriteUsernameDefined()).isTrue();
    }

}


text:
package com.b2international.index;

import java.io.IOException;
import java.util.Iterator;

import com.b2international.index.aggregations.Aggregation;
import com.b2international.index.aggregations.AggregationBuilder;
import com.b2international.index.query.Query;

/**
 * @since 4.7
 */
public interface Searcher {

	/**
	 * Execute the given query among all stored items.
	 *
	 * @param query
	 *            - the query to execute
	 * @return - an {@link Iterable} of matching values
	 * @throws IOException
	 *             - if something goes wrong during the execution of the query
	 */
	<T> Hits<T> search(Query<T> query) throws IOException;

	/**
	 * Scrolls to the next page of a query using the given {@link Scroll} configuration.
	 *
	 * @param scroll
	 * @return
	 * @throws IOException
	 */
	<T> Hits<T> scroll(Scroll<T> scroll) throws IOException;

	/**
	 * Cancels an ongoing scroll using the scrollId.
	 * @param scrollId
	 */
	void cancelScroll(String scrollId);

	/**
	 * Execute an aggregation among all stored documents.
	 *
	 * @param aggregation
	 * @return
	 * @throws IOException
	 */
	<T> Aggregation<T> aggregate(AggregationBuilder<T> aggregation) throws IOException;

	/**
	 * Returns an {@link Iterable} to scroll through all matches of the given query. If the query does not specify scroll keep alive, then the
	 * implementation will use the default {@link Query#DEFAULT_SCROLL_KEEP_ALIVE} value.
	 *
	 * @param query
	 * @return
	 */
	default <T> Iterable<Hits<T>> scroll(Query<T> query) {
		return new Iterable<Hits<T>>() {
			@Override
			public Iterator<Hits<T>> iterator() {
				return new ScrollingIterator<T>(Searcher.this, query);
			}
		};
	}

}


text:
import React, { Component, PropTypes } from 'react';
import {
  StyleSheet,
  Text,
  TouchableOpacity,
  View,
  ScrollView
} from 'react-native';
import Title from './title';

export default class SideBar extends Component {

  static propTypes = {
    items: PropTypes.arrayOf(PropTypes.shape({
      item: PropTypes.string.isRequired,
      subItems: PropTypes.arrayOf(PropTypes.string)
    })).isRequired,
    onSelection: PropTypes.func
  };

  state = {
    selected: null
  };

  componentWillMount() {
    this.handleSelection(this.props.items[0]);
  }

  getSelectedSubItems() {
    let selectedItem = this.props.items.filter(i => i.item === this.state.selected.item)[0];
    return selectedItem.subItems || [];
  }

  setSelected(value) {
    this.setState({ selected: value }, () => {
      if (this.props.onSelection) {
        this.props.onSelection(value);
      }
    });
  }

  handleSelection(value) {
    this.setSelected({
      item: value.item,
      sub: value.subItems && value.subItems[0]
    });
  }

  handleSubSelection(value) {
    this.setSelected({
      item: this.state.selected.item,
      sub: value
    });
  }

  renderSubItems() {
    let { selected } = this.state;
    let subItems = this.getSelectedSubItems();
    return subItems.map(name => {
      let isSelected = selected.sub === name;
      let subItemStyle = isSelected ? styles.selectedSubItem : {};
      return (
        <TouchableOpacity
          key={ name }
          onPress={ ()=> this.handleSubSelection(name) }
          style={ [ styles.item, styles.subItem, subItemStyle ] }
        >
          <Text style={ [ styles.itemLabel, styles.selectedItemLabel ] }>{ name }</Text>
        </TouchableOpacity>
      );
    })
  }

  renderItems() {
    let { selected } = this.state;
    return this.props.items.map(i => {
      let isSelected = i.item === selected.item;
      let itemStyle = isSelected ? styles.selected : {};
      let subItems = isSelected  ? this.renderSubItems() : null;
      let itemLabelStyle = isSelected ? styles.selectedItemLabel : {};
      return (
        <View key={ i.item }>
          <TouchableOpacity
            onPress={ ()=> this.handleSelection(i) }
            style={ [ styles.item, itemStyle ] }
          >
            <Text style={ [ styles.itemLabel, itemLabelStyle ] }>{ i.item }</Text>
          </TouchableOpacity>
          { subItems }
        </View>
      );
    });
  }

  render() {
    let items = this.renderItems();
    return (
      <ScrollView style={ styles.container }>
        <Title>Components</Title>
        { items }
      </ScrollView>
    );
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'black',
    borderRightWidth: 1,
    borderRightColor: 'white'
  },
  item: {
    alignSelf: 'stretch',
    borderBottomWidth: 1,
    borderBottomColor: 'grey',
    padding: 15
  },
  itemLabel: {
    color: 'grey'
  },
  selected: {
    backgroundColor: '#344141',
    borderLeftWidth: 0,
    borderLeftColor: '#343C3C',
  },
  selectedItemLabel: {
    color: 'white'
  },
  subItem: {
    paddingLeft: 20,
    backgroundColor: '#344141'
  },
  selectedSubItem: {
    borderLeftWidth: 5,
    backgroundColor: '#344141',
    borderLeftColor: '#3B7171'
  }
});


text:
<?xml version="1.0" encoding="utf-8"?>
<doctrine-mapping xmlns="http://doctrine-project.org/schemas/orm/doctrine-mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://doctrine-project.org/schemas/orm/doctrine-mapping http://doctrine-project.org/schemas/orm/doctrine-mapping.xsd">
  <entity name="AppBundle\Entity\Ssd" table="ssd">
    <id name="id" type="integer" column="id">
      <generator strategy="IDENTITY"/>
    </id>
    <field name="name" type="string" column="name" length="255" nullable="false">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="manufacturer" type="string" column="manufacturer" length="255" nullable="false">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="storageCap" type="string" column="storageCap" length="255" nullable="false">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="watts" type="integer" column="watts" nullable="false">
      <options>
        <option name="fixed"/>
      </options>
    </field>
    <field name="price" type="integer" column="price" nullable="false">
      <options>
        <option name="fixed"/>
      </options>
    </field>
  </entity>
</doctrine-mapping>


text:
#include "fftw_traits.hh"

namespace HyperCanny {
namespace numeric {
namespace fourier
{
    //=======================================================================//
    //                          Double precision                             //
    //=======================================================================//
    typename RFFT_traits<double>::forward_planner_t
        RFFT_traits<double>::forward_plan
        = fftw_plan_dft_r2c;

    typename RFFT_traits<double>::inverse_planner_t
        RFFT_traits<double>::inverse_plan
        = fftw_plan_dft_c2r;

    double *(*RFFT_traits<double>::alloc_real)(size_t)
        = fftw_alloc_real;

    typename RFFT_traits<double>::complex_t *(*RFFT_traits<double>::alloc_complex)(size_t)
        = fftw_alloc_complex;

    void (*RFFT_traits<double>::free)(void *)
        = fftw_free;

    void (*RFFT_traits<double>::execute)(typename RFFT_traits<double>::plan_t)
        = fftw_execute;

    void (*RFFT_traits<double>::destroy_plan)(typename RFFT_traits<double>::plan_t)
        = fftw_destroy_plan;

    //=======================================================================//
    //                          Single precision                             //
    //=======================================================================//
    typename RFFT_traits<float>::forward_planner_t
        RFFT_traits<float>::forward_plan
        = fftwf_plan_dft_r2c;

    typename RFFT_traits<float>::inverse_planner_t
        RFFT_traits<float>::inverse_plan
        = fftwf_plan_dft_c2r;

    float *(*RFFT_traits<float>::alloc_real)(size_t)
        = fftwf_alloc_real;

    typename RFFT_traits<float>::complex_t *(*RFFT_traits<float>::alloc_complex)(size_t)
        = fftwf_alloc_complex;

    void (*RFFT_traits<float>::free)(void *)
        = fftwf_free;

    void (*RFFT_traits<float>::execute)(typename RFFT_traits<float>::plan_t)
        = fftwf_execute;

    void (*RFFT_traits<float>::destroy_plan)(typename RFFT_traits<float>::plan_t)
        = fftwf_destroy_plan;
}}} // namespace HyperCanny::numeric::fourier


text:
namespace Slang
{

struct ErrorHandlingLoweringContext
{
    IRModule* module;
    DiagnosticSink* diagnosticSink;

    SharedIRBuilder sharedBuilder;

    List<IRInst*> workList;
    HashSet<IRInst*> workListSet;

    void addToWorkList(IRInst* inst)
    {
        if (workListSet.Contains(inst))
            return;

        workList.add(inst);
        workListSet.Add(inst);
    }

    void processFuncType(IRFuncType* funcType)
    {
        auto throwAttr = funcType->findAttr<IRFuncThrowTypeAttr>();
        if (!throwAttr)
            return;
        IRBuilder builder(sharedBuilder);
        builder.setInsertBefore(funcType);
        auto resultType =
            builder.getResultType(funcType->getResultType(), throwAttr->getErrorType());
        List<IRType*> paramTypes;
        for (UInt i = 0; i < funcType->getParamCount(); i++)
        {
            if (as<IRAttr>(funcType->getParamType(i)))
                break;
            paramTypes.add(funcType->getParamType(i));
        }
        auto newFuncType = builder.getFuncType(paramTypes, resultType);
        sharedBuilder.replaceGlobalInst(funcType, newFuncType);
    }

    void processTryCall(IRTryCall* tryCall)
    {
        // If we see:
        // ```
        //      value = tryCall(callee, successBlock, failBlock, args)
        //  successBlock:
        //      resultParam = IRParam<resultType>
        //      ... (uses resultParam) ...
        //  failBlock:
        //      errorParam = IRParam<errorType>
        //      (uses errorParam)
        // ```
        // We need to rewrite it as
        // ```
        //      result = call(callee) : Result<callee.returnType, callee.errorType>
        //      isError = isResultError(result)
        //      ifElse(isError, failBlock, successBlock)
        //  successBlock:
        //      value = getResultValue(result) : returnType
        //      ... (replaces resultParam with value)
        //  failBlock:
        //      error = getResultError(result) : errorType
        //      ... (replaces errorParam with error)
        // ```
        IRFuncType* funcType = cast<IRFuncType>(tryCall->getCallee()->getDataType());
        auto resultValueType = funcType->getResultType();
        auto throwAttr = funcType->findAttr<IRFuncThrowTypeAttr>();
        if (!throwAttr)
        {
            SLANG_ASSERT_FAILURE("tryCall applied to callee without a IRFuncThrowTypeAttr");
        }
        auto errorType = throwAttr->getErrorType();

        IRBuilder builder(sharedBuilder);
        builder.setInsertBefore(tryCall);

        auto resultType = builder.getResultType(resultValueType, errorType);
        List<IRInst*> args;
        for (UInt i = 0; i < tryCall->getArgCount(); i++)
        {
            args.add(tryCall->getArg(i));
        }
        auto call = builder.emitCallInst(resultType, tryCall->getCallee(), args);
        tryCall->transferDecorationsTo(call);

        auto isFail = builder.emitIsResultError(call);
        auto failBlock = tryCall->getFailureBlock();
        auto successBlock = tryCall->getSuccessBlock();

        builder.emitIf(isFail, failBlock, successBlock);

        // Replace the params in failBlock to `getResultError(call)`.
        builder.setInsertBefore(failBlock->getFirstOrdinaryInst());
        auto errorParam = failBlock->getFirstParam();
        auto errVal = builder.emitGetResultError(call);
        errorParam->replaceUsesWith(errVal);
        errorParam->removeAndDeallocate();

        // Replace the params in successBlock to `getResultValue(call)`.
        builder.setInsertBefore(successBlock->getFirstOrdinaryInst());
        auto resultParam = successBlock->getFirstParam();
        auto resultValue = builder.emitGetResultValue(call);
        resultParam->replaceUsesWith(resultValue);
        resultParam->removeAndDeallocate();

        tryCall->removeAndDeallocate();
    }

    void processReturn(IRReturn* ret)
    {
        auto parentFunc = getParentFunc(ret);
        if (!parentFunc)
            return;
        auto funcType = cast<IRFuncType>(parentFunc->getDataType());
        auto throwAttr = funcType->findAttr<IRFuncThrowTypeAttr>();
        if (!throwAttr)
            return;

        // If we are in a throwing function and sees a `return(val)` inst,
        // replace it with a `return makeResultValue(val)`, so that it returns a `Result<T,E>` type.
        IRBuilder builder(sharedBuilder);
        builder.setInsertBefore(ret);
        auto resultType =
            builder.getResultType(funcType->getResultType(), throwAttr->getErrorType());
        IRInst* resultVal = nullptr;
        auto val = cast<IRReturn>(ret)->getVal();
        resultVal = builder.emitMakeResultValue(resultType, val);
        builder.emitReturn(resultVal);
        ret->removeAndDeallocate();
    }

    void processThrow(IRThrow* throwInst)
    {
        auto parentFunc = getParentFunc(throwInst);
        SLANG_ASSERT(parentFunc);
        auto funcType = cast<IRFuncType>(parentFunc->getDataType());
        auto throwAttr = funcType->findAttr<IRFuncThrowTypeAttr>();
        SLANG_ASSERT(throwAttr);

        // If we are in a throwing function and sees a `throw(e)` inst,
        // replace it with a `return makeResultError(e)`.
        IRBuilder builder(sharedBuilder);
        builder.setInsertBefore(throwInst);
        auto resultType =
            builder.getResultType(funcType->getResultType(), throwAttr->getErrorType());
        IRInst* resultVal = builder.emitMakeResultError(resultType, throwInst->getValue());
        builder.emitReturn(resultVal);
        throwInst->removeAndDeallocate();
    }

    void processInst(IRInst* inst)
    {
        switch (inst->getOp())
        {
        case kIROp_TryCall:
            processTryCall(cast<IRTryCall>(inst));
            break;
        case kIROp_Return:
            processReturn(cast<IRReturn>(inst));
            break;
        case kIROp_Throw:
            processThrow(cast<IRThrow>(inst));
            break;
        default:
            break;
        }
    }

    void processInsts()
    {
        addToWorkList(module->getModuleInst());

        while (workList.getCount() != 0)
        {
            IRInst* inst = workList.getLast();

            workList.removeLast();
            workListSet.Remove(inst);

            processInst(inst);

            for (auto child = inst->getLastChild(); child; child = child->getPrevInst())
            {
                addToWorkList(child);
            }
        }
    }

    void processModule()
    {
        // Deduplicate equivalent types.
        sharedBuilder.deduplicateAndRebuildGlobalNumberingMap();

        // Translate all IRTryCall, IRThrow, IRReturn.
        processInsts();

        // Lower all functypes.
        // Function types with an IRThrowTypeAttribute will be translated into a normal function
        // type that returns `Result<T,E>`.
        List<IRFuncType*> oldFuncTypes;
        for (auto child : module->getGlobalInsts())
        {
            switch (child->getOp())
            {
            case kIROp_FuncType:
                oldFuncTypes.add(cast<IRFuncType>(child));
                break;
            default:
                break;
            }
        }
        for (auto funcType : oldFuncTypes)
        {
            processFuncType(funcType);
        }
    }
};

void lowerErrorHandling(IRModule* module, DiagnosticSink* sink)
{
    ErrorHandlingLoweringContext context;
    context.module = module;
    context.diagnosticSink = sink;
    context.sharedBuilder.init(module);
    return context.processModule();
}
}


text:
<?php

namespace Commercetools\Core\Model\Common;

/**
 * @package Commercetools\Core\Model\Common
 *
 * @method string getContainer()
 * @method ContainerAndKey setContainer(string $container = null)
 * @method string getKey()
 * @method ContainerAndKey setKey(string $key = null)
 */
class ContainerAndKey extends JsonObject
{
    public function fieldDefinitions()
    {
        return [
            'container' => [self::TYPE => 'string'],
            'key' => [self::TYPE => 'string'],
        ];
    }
}


text:
<!DOCTYPE html>
<meta name="color-scheme" content="light dark">
<script src="../../../../resources/run-after-layout-and-paint.js"></script>
<script src="../../resources/common.js"></script>
<body>
<input type="radio" checked/>
<br>
<input type="radio" checked id="pressTarget"/>
<script>
runAfterLayoutAndPaint(function() {
  var target = document.getElementById('pressTarget');
  pressElement(target)
}, true);
</script>
</body>


text:
export function defaultGetNodeKey({ treeIndex }) {
  return treeIndex;
}

// Cheap hack to get the text of a react object
function getReactElementText(parent) {
  if (typeof parent === 'string') {
    return parent;
  }

  if (
    typeof parent !== 'object' ||
    !parent.props ||
    !parent.props.children ||
    (typeof parent.props.children !== 'string' &&
      typeof parent.props.children !== 'object')
  ) {
    return '';
  }

  if (typeof parent.props.children === 'string') {
    return parent.props.children;
  }

  return parent.props.children
    .map(child => getReactElementText(child))
    .join('');
}

// Search for a query string inside a node property
function stringSearch(key, searchQuery, node, path, treeIndex) {
  if (typeof node[key] === 'function') {
    return (
      String(node[key]({ node, path, treeIndex })).indexOf(searchQuery) > -1
    );
  } else if (typeof node[key] === 'object') {
    return getReactElementText(node[key]).indexOf(searchQuery) > -1;
  }

  return node[key] && String(node[key]).indexOf(searchQuery) > -1;
}

export function defaultSearchMethod({ node, path, treeIndex, searchQuery }) {
  return (
    stringSearch('title', searchQuery, node, path, treeIndex) ||
    stringSearch('subtitle', searchQuery, node, path, treeIndex)
  );
}


text:
/*
 * Three-dimensional pattern in C++ based on the "Rings" Processing example.
 *
 * This version samples colors from an image, rather than using the HSV colorspace.
 *
 * Uses noise functions modulated by sinusoidal rings, which themselves
 * wander and shift according to some noise functions.
 *
 * (c) 2014 Micah Elizabeth Scott
 * http://creativecommons.org/licenses/by/3.0/
 */

#pragma once

#include <math.h>
#include <time.h>
#include <stdlib.h>
#include "lib/color.h"
#include "lib/effect.h"
#include "lib/noise.h"
#include "lib/texture.h"

class RingsEffect : public Effect
{
public:
    RingsEffect(const char *palette)
        : palette(palette)
    {
        reseed();
    }

    static const float xyzSpeed = 0.6;
    static const float xyzScale = 0.08;
    static const float wSpeed = 0.2;
    static const float wRate = 0.015;
    static const float ringScale = 1.5;
    static const float ringScaleRate = 0.01;
    static const float ringDepth = 0.2;
    static const float wanderSpeed = 0.04;
    static const float wanderSize = 1.2;
    static const float brightnessContrast = 8.0;
    static const float colorContrast = 4.0;
    static const float targetBrightness = 0.1;
    static const float thresholdGain = 0.1;
    static const float thresholdStepLimit = 0.02;
    static const float initialThreshold = -1.0f;
    static const unsigned brightnessOctaves = 4;
    static const unsigned colorOctaves = 2;

    // Sample colors along a curved path through a texture
    Texture palette;

    // State variables
    Vec4 d;
    float timer;
    float seed;
    float threshold;

    // Calculated once per frame
    float spacing;
    float colorParam;
    float pixelTotalNumerator;
    unsigned pixelTotalDenominator;
    bool is3D;
    Vec3 center;

    virtual void beginFrame(const FrameInfo &f)
    {
        timer += f.timeDelta;

        spacing = sq(0.5 + noise2(timer * ringScaleRate, 1.5)) * ringScale;

        // Rotate movement in the XZ plane
        float angle = noise2(timer * 0.01, seed + 30.5) * 10.0;
        float speed = pow(fabsf(noise2(timer * 0.01, seed + 40.5)), 2.5) * xyzSpeed;
        d[0] += cosf(angle) * speed * f.timeDelta;
        d[2] += sinf(angle) * speed * f.timeDelta;

        // Random wander along the W axis
        d[3] += noise2(timer * wRate, seed + 3.5) * wSpeed * f.timeDelta;

        // Update center position
        center = Vec3(noise2(timer * wanderSpeed, seed + 50.9),
                      noise2(timer * wanderSpeed, seed + 51.4),
                      noise2(timer * wanderSpeed, seed + 51.7)) * wanderSize;

        // Wander around the color palette
        colorParam = seed + timer * 0.05f;

        // Reset pixel total accumulators, used for the brightness calc in endFrame
        pixelTotalNumerator = 0;
        pixelTotalDenominator = 0;

        // Is this 2D or 3D?
        is3D = false;
        for (Effect::PixelInfoIter i = f.pixels.begin(), e = f.pixels.end(); i != e; ++i) {
            const Effect::PixelInfo &p = *i;
            if (p.point[1] != 0.0f) {
                is3D = true;
            }
        }
    }

    virtual void shader(Vec3& rgb, const PixelInfo &p) const
    {
        // Noise sampling location
        Vec4 s = Vec4(p.point * xyzScale, seed) + d;

        // Ring function, displaces the noise sampling coordinate
        float dist = len(p.point - center);
        Vec4 pulse = Vec4(sinf(d[2] + dist * spacing) * ringDepth, 0, 0, 0);

        /*
         * Brightness is calculated by:
         *
         *    n = (fbm_noise4(s + pulse, octaves) + threshold) * brightnessContrast;
         *
         * But if we can determine that n <= 0, we can exit early. Check this after
         * each fbm octave, to see if we can save another costly noise calculation.
         * Also, use 3D noise instead of 4D if the Y axis is unused.
         */

        float n = threshold * brightnessContrast;
        float amplitude = brightnessContrast;
        Vec4 arg = s + pulse;
        unsigned i = brightnessOctaves;

        while (true) {
            n += amplitude * dNoise(arg);
            --i;
            if (!(n > -amplitude * fbmTotal(i))) {
                // Too low for further octaves to bring back above 0.
                // On the last octave, note fbmTotal(0) == 0
                // Should also exit in case of NaN.
                return;
            }
            if (!i) {
                break;
            }

            amplitude *= 0.5f;
            arg *= 2.0f;
        }
        n /= fbmTotal(brightnessOctaves);

        /*
         * Another hybrid 2D/3D fbm for chroma. Use half the octaves.
         */

        float m = 0;
        amplitude = colorContrast;
        arg = s + Vec4(0, 0, 0, 10);
        i = colorOctaves;

        while (true) {
            m += amplitude * dNoise(arg);
            if (--i == 0) {
                break;
            }

            amplitude *= 0.5f;
            arg *= 2.0f;
        }
        m /= fbmTotal(colorOctaves);

        // Assemble color using a lookup through our palette
        rgb = color(colorParam + m, sq(n));
    }

    inline void postProcess(const Vec3& rgb, const PixelInfo& p)
    {
        // Keep a rough approximate brightness total, for closed-loop feedback
        for (unsigned i = 0; i < 3; i++) {
            pixelTotalNumerator += sq(std::min(1.0f, std::max(0.0f, rgb[i])));
            pixelTotalDenominator++;
        }
    }

    virtual void endFrame(const FrameInfo &f)
    {
        // Per-frame brightness calculations.
        // Adjust threshold in brightness-determining noise function, in order
        // to try and keep the average pixel brightness at a particular level.

        float target = targetBrightness;
        float current = pixelTotalDenominator ? pixelTotalNumerator / pixelTotalDenominator : 0.0f;
        bool blackLevel = current <= 0.0f;

        if (wantToReseed()) {
            // Fade to black
            target = 0;

            if (blackLevel) {
                // At black level. Reseed invisibly!
                reseed();
            }
        }

        // Rate limited servo loop.
        // Disabled if we aren't calculating pixel values.

        if (pixelTotalDenominator) {
            float step = (target - current) * thresholdGain;
            if (step > thresholdStepLimit) step = thresholdStepLimit;
            if (step < -thresholdStepLimit) step = -thresholdStepLimit;
            threshold += step;
        }
    }

    virtual void debug(const DebugInfo &di)
    {
        fprintf(stderr, "\t[rings] %s model\n", is3D ? "3D" : "2D");
        fprintf(stderr, "\t[rings] seed = %f%s\n", seed, wantToReseed() ? " [reseed pending]" : "");
        fprintf(stderr, "\t[rings] timer = %f\n", timer);
        fprintf(stderr, "\t[rings] center = %f, %f, %f\n", center[0], center[1], center[2]);
        fprintf(stderr, "\t[rings] d = %f, %f, %f, %f\n", d[0], d[1], d[2], d[3]);
        fprintf(stderr, "\t[rings] threshold = %f\n", threshold);
    }

private:
    // Totally reinitialize our state variables. We do this periodically
    // during normal operation, during blank periods.

    void reseed()
    {
        // Get okay seed mixing even with depressing rand() implementations
        srand(time(0));
        for (int i = 0; i < 50; i++) {
            rand();
        }
        seed = rand() / double(RAND_MAX / 1024);

        // Starting point
        d = Vec4(0,0,0,0);
        timer = 0;

        // Initial threshold gives us time to fade in
        threshold = initialThreshold;
    }

    // Do our state variables need resetting? This is like a watchdog timer,
    // keeping an eye on the simulation parameters. If we need to start over,
    // we'll start fading out and reseed during the darkness. This will happen
    // periodically in order to keep our numbers within the useful resolution of
    // a 32-bit float.

    bool wantToReseed()
    {
        // Comparisons carefully written to NaN always causes reseed
        return !(timer < 9000.0f) |
               !(threshold <  10.0f) |
               !(threshold > -10.0f) |
               !(d[0] < 1000.0f) |
               !(d[1] < 1000.0f) |
               !(d[2] < 1000.0f) |
               !(d[3] < 1000.0f) |
               !(d[0] > -1000.0f) |
               !(d[1] > -1000.0f) |
               !(d[2] > -1000.0f) |
               !(d[3] > -1000.0f) ;
    }

    // Sample a color from our palette, using a lissajous curve within an image texture

    Vec3 color(float parameter, float brightness) const
    {
        return palette.sample( sinf(parameter) * 0.5f + 0.5f,
                               sinf(parameter * 0.86f) * 0.5f + 0.5f) * brightness;
    }

    // Sample 3 or 4 dimensional noise. If (!is3D), we use 3 dimensional noise, ignoring the Y axis.

    float dNoise(Vec4 v) const
    {
        return is3D ? noise4(v) : noise3(v[0], v[2], v[3]);
    }

    // Normalization factor for fractional brownian motion with N octaves

    static float fbmTotal(int i)
    {
        float n = 0;
        float amp = 1.0f;
        while (i > 0) {
            n += amp;
            amp *= 0.5;
            i--;
        }
        return n;
    }
};


text:
<?php

  //iniciamos sesión - SIEMPRE TIENE QUE ESTAR EN LA PRIMERA LÍNEA
  session_start();
  include("conexion.proc.php");

extract($_REQUEST);

//ahora hacemos otra connsulta para obtener los id integrante segun la matricula del alumno

for ($cont=0; $cont < count($notas) ; $cont++) {

  $sql = "SELECT `part_id` FROM `tbl_participantes` WHERE usa_id = ".$matriculas[$cont];

    $resultado= mysqli_query($conexion, $sql) or die (mysqli_error());

    while($fila = mysqli_fetch_array($resultado)){

      $sql = "INSERT INTO `tbl_notaalumno` (`na_id`, `pa_id`, `na_nota`, `part_id`) VALUES (NULL, '".$idpreguntas[$cont]."', '".$notas[$cont]."', '".$fila['part_id']."');";

    }

    //una vez echo el sql, ejecutamos la consuta.
      echo "
";
      echo $notas[$cont]." ".$idpreguntas[$cont]." ".$matriculas[$cont]."
";
      echo $sql;

$resultado= mysqli_query($conexion, $sql) or die (mysqli_error());

}

$id=5;

for ($cont=0; $cont < count($notas_globales) ; $cont++) {

  $sql = "SELECT `part_id` FROM `tbl_participantes` WHERE usa_id = ".$matriculas[$cont];

    $resultado= mysqli_query($conexion, $sql) or die (mysqli_error());

    while($fila = mysqli_fetch_array($resultado)){

      $sql = "INSERT INTO `tbl_notaalumno` (`na_id`, `pa_id`, `na_nota`, `part_id`) VALUES (NULL, '".$id."', '".$notas_globales[$cont]."', '".$fila['part_id']."');";

    }

    //una vez echo el sql, ejecutamos la consuta.
      echo "
 Globales
";
      echo $notas[$cont]." ".$idpreguntas[$cont]." ".$matriculas[$cont]."
";
      echo $sql;

$resultado= mysqli_query($conexion, $sql) or die (mysqli_error());

$id++;

}

header("location: mainalumno.php");

echo "\\\\\\\\".$proyecto."////////" ;

?>


text:
"""
Finalproject.py
Author: Sam Pych
Credit: Thomas Kyle Postans, Hagin, My Space Game, David Wilson
Assignment: Create a pong game with two movable blocks and the ball either bounces off the wall
or appears on the other side.
optional: keep score
bounde=self.collidingWithSprites(Pongblock1)
"""
from ggame import App, Sprite, ImageAsset, Frame
from ggame import SoundAsset, Sound, TextAsset, Color
import math
from time import time
from ggame import App, Color, LineStyle, Sprite, RectangleAsset, CircleAsset, EllipseAsset, PolygonAsset
from ggame import App, RectangleAsset, ImageAsset, Sprite, LineStyle, Color, Frame

class Pongblock(Sprite):
    black = Color(0x000000, 1.0)
    thinline= LineStyle(1, black)
    rectangle_asset=RectangleAsset(50, 100, thinline, black)
    #rectangle1 = Sprite(rectangle_asset, (1100,250))
    def __init__(self, position):
        super().__init__(Pongblock1.rectangle_asset, position)
        self.vy = 1
        ponggame.listenKeyEvent("keydown", "up arrow", self.up)
        ponggame.listenKeyEvent("keydown","left arrow",self.left)
        ponggame.listenKeyEvent("keydown","down arrow",self.down)
        ponggame.listenKeyEvent("keydown","right arrow",self.right)
        self.fxcenter = self.fycenter = 0.5
    def step(self):
        self.y += self.vy
        #self.y += self.vy
        if self.y >480:
            self.y=479
        if self.y <-1:
            self.y=0
    def up(self, event):
        self.vy -=2
    def down(self, event):
        self.vy +=2
    def left(self, event):
        self.vx -=2
    def right(self, event):
        self.vx +=2

class Pongblock1(Sprite):
    black = Color(0x000000, 1.0)
    thinline= LineStyle(1, black)
    rectangle_asset=RectangleAsset(50, 100, thinline, black)
    #rectangle1 = Sprite(rectangle_asset, (1100,250))
    def __init__(self, position):
        super().__init__(Pongblock1.rectangle_asset, position)
        self.vy = 1
        ponggame.listenKeyEvent("keydown", "w", self.up)
        ponggame.listenKeyEvent("keydown","a",self.left)
        ponggame.listenKeyEvent("keydown","s",self.down)
        ponggame.listenKeyEvent("keydown","d",self.right)
        self.fxcenter = self.fycenter = 0.5
    def step(self):
        self.y += self.vy
        #self.y += self.vy
        if self.y >480:
            self.y=479
        if self.y <-1:
            self.y=0
    def up(self, event):
        self.vy -=2
    def down(self, event):
        self.vy +=2
    def left(self, event):
        self.vx -=2
    def right(self, event):
        self.vx +=2

class pongball(Sprite):
    red = Color(0xff0000, 1.0)
    thinline= LineStyle(1, red)
    circle_asset=CircleAsset(25, thinline, red)
    #circle1 = Sprite(circle_asset, (600,300))
    circle=CircleAsset(1500, thinline, red)
    def __init__(self, position):
        super().__init__(pongball.circle_asset, position)
        self.vx = 2
        self.vy = 10
        previousY = self.vy
        self.fxcenter = self.fycenter = 0.5
    def step(self):
        self.x += self.vx
        self.y += self.vy
        if self.y >500:
            self.vy=-7
        if self.y <-1:
            self.vy=7
        if self.visible:
            collides = self.collidingWithSprites(Scoreline)
            if len(collides):
                if collides[0].visible:
                    print("arrow keys win")
                    self.x += self.vx
                    self.x += self.vx
                    return True
        if self.visible:
            collides2 = self.collidingWithSprites(Scoreline2)
            if len(collides2):
                if collides2[0].visible:
                    print("wasd wins")
                    self.x += self.vx
                    self.x += self.vx
        if self.visible:
            collides3 = self.collidingWithSprites(Pongblock1)
            if len(collides3):
                if collides3[0].visible:
                    self.vx = 6
                    self.vy = 6
                    self.x += self.vx
                    self.y += self.vy
        if self.visible:
            collides4 = self.collidingWithSprites(Pongblock)
            if len(collides4):
                if collides4[0].visible:
                    self.vx = -6
                    self.vy = -4
                    self.x += self.vx
                    self.y += self.vy

class Scoreline(Sprite):
    blue = Color(0x0000ff, 1.0)
    thinline= LineStyle(1, blue)
    rectangle_asset=RectangleAsset(10, 2000, thinline, blue)
    #rectangle = Sprite(rectangle_asset, (00,-100))
    def __init__(self, position):
        super().__init__(Scoreline.rectangle_asset, position)
class Scoreline2(Sprite):
    blue = Color(0x0000ff, 1.0)
    thinline= LineStyle(1, blue)
    rectangle_asset=RectangleAsset(10, 2000, thinline, blue)
    #rectangle = Sprite(rectangle_asset, (1200,-100))
    def __init__(self, position):
        super().__init__(Scoreline2.rectangle_asset, position)

#class Scoreboard:
# Not enough time to do it
class ponggame(App):
    def __init__(self, width, height):
        super().__init__(width, height)
        Pongblock1((100,10))
        Scoreline((00,-100))
        Pongblock((1100,250))
        Scoreline2((1200,-100))
        pongball((1000,100))
        print(self.getSpritesbyClass(pongball))

    def step(self):
        for x in self.getSpritesbyClass(Pongblock1):
            x.step()
        for x in self.getSpritesbyClass(Pongblock):
            x.step()
        for x in self.getSpritesbyClass(pongball):
            x.step()
    def restart(self):
        ponggame.listenKeyEvent("keydown","spacebar",self.restart)
app = ponggame(0,0)
app.run()