text:
Q: Dynamic CardViews inside a Grid alike view I am trying to create different patterns of CardViews, align them horizontally and vertically and put them inside one big  LinearLayout, in order to achieve the following:

I have created the first and the last Card views, but I am having trouble creating the cardviews in between, with all their features such as: the vertical divider, and the cut in the edges horizontal divider between the first and the second cardviews.
(**red Scissors and the blue circle are png's)
I am open to any other suggestions that may accomplish this commplicated "GridView" alike xml code.
I added my xml code:
        <?xml version="1.0" encoding="utf-8" ?>
    <LinearLayout
        xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:local="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:fitsSystemWindows="true"
        android:background="@color/screen_backround_color"
        android:orientation="vertical"
        android:layout_weight="100">

      <LinearLayout
          android:layout_width="wrap_content"
          android:layout_height="0dp"
          android:background="@drawable/frame_border"
          android:orientation="vertical"
          android:layout_marginLeft="15dp"
          android:layout_marginRight="15dp"
          android:layout_marginTop="15dp"
          android:layout_marginBottom="15dp"
          android:layout_weight="90">
        <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

          <android.support.v7.widget.CardView
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:card_view="http://schemas.android.com/apk/res-auto"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  card_view:cardCornerRadius="0dp"
                  card_view:cardElevation="0dp"
                  card_view:contentPadding="15dp"
                  card_view:cardUseCompatPadding="true"
                  android:id="@+id/MainFormFirstRow">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:gravity="center_vertical"
                android:orientation="horizontal">

              <!--Model Name-->
              <LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center_vertical"
                  android:orientation="vertical">

                <TextView
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Model Name"
                    android:textColor="#ec1c24"
                    android:textSize="16dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/editTextModelName"
                    style="@style/Base.TextAppearance.AppCompat.Body1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#666666"
                    android:textSize="30dp"
                    android:textStyle="bold"/>
              </LinearLayout>
              <!--Serial Number, IP Address, Version-->
              <TableLayout
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="1">

                <TableRow>

                  <TextView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_marginRight="15dp"
                      android:text="Model ID:"
                      android:textColor="#ec1c24"
                      android:textSize="14dp"
                      android:textStyle="bold"/>

                  <TextView
                      android:id="@+id/editTextModelId"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textSize="14dp"
                      android:textColor="#666666"/>
                </TableRow>

                <TableRow>

                  <TextView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_marginRight="20dp"
                      android:text="IP:"
                      android:textColor="#ec1c24"
                      android:textSize="14dp"
                      android:textStyle="bold"/>

                  <TextView
                      android:id="@+id/editTextIPAddress"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textSize="14dp"
                      android:textColor="#666666"/>
                </TableRow>

                <TableRow>

                  <TextView
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_marginRight="20dp"
                      android:text="BS Version:"
                      android:textColor="#ec1c24"
                      android:textSize="14dp"
                      android:textStyle="bold"/>

                  <TextView
                      android:id="@+id/editTextPLC"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textSize="14dp"
                      android:textColor="#666666"/>
                </TableRow>

              </TableLayout>

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

          <android.support.v7.widget.CardView
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:card_view="http://schemas.android.com/apk/res-auto"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  card_view:cardCornerRadius="0dp"
                  card_view:cardElevation="0dp"
                  card_view:contentPadding="15dp"
                  card_view:cardUseCompatPadding="true"
                  android:id="@+id/MainFormSecondRow">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:gravity="center_horizontal"
                android:orientation="horizontal">

              <!--IOMapping1-->
              <LinearLayout
                  android:id="@+id/tableRowIOMapping1"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center_horizontal"
                  android:orientation="horizontal">

                <TextView
                    android:id="@+id/textViewIOMapping1"
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Temperature"
                    android:textColor="#6d6e70"
                    android:textSize="16dp"
                    android:textStyle="bold" />
                <TextView
                    android:id="@+id/editTextIOMapping1"
                    style="@style/Base.TextAppearance.AppCompat.Body1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#8bc53f"
                    android:textSize="30dp"
                    android:textStyle="bold"
                    android:enabled="false"/>
              </LinearLayout>
              <!--IOMapping2-->
              <LinearLayout
                  android:id="@+id/tableRowIOMapping2"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center_horizontal"
                  android:orientation="horizontal">

                <TextView
                    android:id="@+id/textViewIOMapping2"
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Pressure"
                    android:textColor="#6d6e70"
                    android:textSize="16dp"
                    android:textStyle="bold" />
                <TextView
                    android:id="@+id/editTextIOMapping2"
                    style="@style/Base.TextAppearance.AppCompat.Body1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#8bc53f"
                    android:textSize="30dp"
                    android:textStyle="bold"
                    android:enabled="false"/>
              </LinearLayout>
            </LinearLayout>
          </android.support.v7.widget.CardView>

          <android.support.v7.widget.CardView
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:card_view="http://schemas.android.com/apk/res-auto"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  card_view:cardCornerRadius="0dp"
                  card_view:cardElevation="0dp"
                  card_view:contentPadding="15dp"
                  card_view:cardUseCompatPadding="true"
                  android:layout_marginBottom="1dp"
                  android:id="@+id/MainFormThirdRow">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:gravity="center_horizontal"
                android:orientation="horizontal">

              <!--Current Cycle Name-->
              <LinearLayout
                  android:id="@+id/tableRowIOMapping1"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center_horizontal"
                  android:orientation="horizontal">
                <TextView
                    android:id="@+id/textViewCycleName"
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Current Cycle Name"
                    android:textColor="#6d6e70"
                    android:textSize="16dp"
                    android:textStyle="bold" />
                <LinearLayout
                    android:id="@+id/editTextCycleName"
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="2"
                    android:gravity="center_horizontal"
                    android:orientation="horizontal">
                  <ImageView
                       android:id="@+id/TwitterImage"
                       android:layout_width="wrap_content"
                       android:layout_height="wrap_content"
                       android:layout_marginLeft="20dp"
                       android:layout_weight="1"
                       android:src="@drawable/icon">
                  </ImageView>
                  <TextView
                      android:id="@+id/editTextCycleName"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:textColor="#ff0000"
                      android:layout_weight="1"
                      android:textSize="16dp"
                      android:textStyle="bold"
                      android:enabled="false"/>
                </LinearLayout>
              </LinearLayout>
              <!--System Status-->
              <LinearLayout
                  android:id="@+id/tableRowIOMapping2"
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center_horizontal"
                  android:orientation="horizontal">
                <LinearLayout
                            android:id="@+id/tableRowIOMapping2"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="2"
                            android:gravity="center_vertical"
                            android:orientation="vertical">
                  <TextView
                      android:id="@+id/textViewSystemStatus"
                      style="@style/Base.TextAppearance.AppCompat.Headline"
                      android:layout_width="wrap_content"
                      android:layout_weight="1"
                      android:layout_height="wrap_content"
                      android:text="System Status"
                      android:textColor="#6d6e70"
                      android:textSize="16dp"
                      android:textStyle="bold" />

                  <TextView
                      android:id="@+id/editTextSystemStatus"
                      style="@style/Base.TextAppearance.AppCompat.Body1"
                      android:layout_width="wrap_content"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:textColor="#8bc53f"
                      android:textSize="20dp"
                      android:textStyle="bold"
                      android:enabled="false"/>
                </LinearLayout>
              </LinearLayout>
            </LinearLayout>
          </android.support.v7.widget.CardView>

          <android.support.v7.widget.CardView
                  xmlns:android="http://schemas.android.com/apk/res/android"
                  xmlns:card_view="http://schemas.android.com/apk/res-auto"
                  xmlns:tools="http://schemas.android.com/tools"
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:orientation="horizontal"
                  card_view:cardCornerRadius="0dp"
                  card_view:cardElevation="0dp"
                  card_view:contentPadding="15dp"
                  card_view:cardUseCompatPadding="true"
                  android:layout_marginBottom="1dp"
                  android:id="@+id/MainFormFirstRow">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="2"
                android:gravity="center_vertical"
                android:orientation="horizontal">

              <!--Cycle Stage-->
              <LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="100"
                  android:gravity="center_vertical"
                  android:orientation="vertical">

                <TextView
                    android:id="@+id/textViewRefTemperature"
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="10"
                    android:text="Cycle Stage"
                    android:textColor="#ec1c24"
                    android:textSize="16dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/editTextCycleStage"
                    style="@style/Base.TextAppearance.AppCompat.Body1"
                    android:layout_weight="20"
                    android:layout_marginLeft="20dp"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#231f20"
                    android:textSize="30dp"
                    android:textStyle="bold"/>

                <ImageView
                     android:id="@+id/FacebookImage"
                     android:layout_weight="70"
                     android:layout_width="wrap_content"
                     android:layout_height="wrap_content"
                     android:layout_marginLeft="20dp"
                     android:src="@drawable/icon">
                </ImageView>
              </LinearLayout>

              <TableLayout
                  android:layout_width="0dp"
                  android:layout_height="wrap_content"
                  android:layout_weight="2">

                <LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:gravity="center_vertical"
                  android:orientation="vertical">

                  <!--Door State-->
                  <LinearLayout
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_weight="1"
                      android:gravity="center_vertical"
                      android:orientation="vertical">

                    <TextView
                        android:id="@+id/textViewChamberTemperature"
                        style="@style/Base.TextAppearance.AppCompat.Headline"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Model Name"
                        android:textColor="#ec1c24"
                        android:textSize="16dp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/editTextDoorState"
                        style="@style/Base.TextAppearance.AppCompat.Body1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="#ff0000"
                        android:textSize="20dp"
                        android:textStyle="bold"/>
                  </LinearLayout>
                </LinearLayout>
                <LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="wrap_content"
                  android:layout_weight="1"
                  android:gravity="center_vertical"
                  android:orientation="vertical">

                  <!--Cycle Error-->
                  <LinearLayout
                      android:layout_width="0dp"
                      android:layout_height="match_parent"
                      android:layout_weight="1"
                      android:gravity="center_vertical"
                      android:orientation="vertical">

                    <TextView
                        android:id="@+id/textViewRefTemperature"
                        style="@style/Base.TextAppearance.AppCompat.Headline"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Model Name"
                        android:textColor="#6d6e70"
                        android:textSize="16dp"
                        android:textStyle="bold" />

                    <TextView
                        android:id="@+id/editTextCycleError"
                        style="@style/Base.TextAppearance.AppCompat.Body1"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="#ff0000"
                        android:textSize="30dp"
                        android:textStyle="bold"/>
                  </LinearLayout>
                </LinearLayout>
              </TableLayout>

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

          <android.support.v7.widget.CardView
                xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:card_view="http://schemas.android.com/apk/res-auto"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                card_view:cardCornerRadius="0dp"
                card_view:cardElevation="0dp"
                card_view:contentPadding="15dp"
                card_view:cardUseCompatPadding="true"
                android:layout_marginBottom="1dp"
                android:id="@+id/MainFormSixtRow">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_weight="3"
                android:gravity="center_vertical"
                android:orientation="horizontal">

              <LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center_vertical"
                  android:orientation="vertical">

                <TextView
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Ster. Temp:"
                    android:textColor="#6d6e70"
                    android:textSize="16dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/plc_ModelName"
                    style="@style/Base.TextAppearance.AppCompat.Body1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#231f20"
                    android:textSize="30dp"
                    android:textStyle="bold"/>
              </LinearLayout>

              <LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center_vertical"
                  android:orientation="vertical">

                <TextView
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Ster. Time:"
                    android:textColor="#ec1c24"
                    android:textSize="16dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/plc_ModelName"
                    style="@style/Base.TextAppearance.AppCompat.Body1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#666666"
                    android:textSize="30dp"
                    android:textStyle="bold"/>
              </LinearLayout>

              <LinearLayout
                  android:layout_width="0dp"
                  android:layout_height="match_parent"
                  android:layout_weight="1"
                  android:gravity="center_vertical"
                  android:orientation="vertical">

                <TextView
                    style="@style/Base.TextAppearance.AppCompat.Headline"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="Dry Time:"
                    android:textColor="#ec1c24"
                    android:textSize="16dp"
                    android:textStyle="bold" />

                <TextView
                    android:id="@+id/plc_ModelName"
                    style="@style/Base.TextAppearance.AppCompat.Body1"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:textColor="#666666"
                    android:textSize="30dp"
                    android:textStyle="bold"/>
              </LinearLayout>
            </LinearLayout>
          </android.support.v7.widget.CardView>

        </LinearLayout>

        </LinearLayout>
    </LinearLayout>

thank you for your help.

A: After hard work of using CardView, android:layout_below and studying on Vertical and Horizontal Dividers, I got a solution. the following Cardview (it could be in a LinearLayout as well) contains the above mockup:
          <android.support.v7.widget.CardView
              xmlns:android="http://schemas.android.com/apk/res/android"
              xmlns:card_view="http://schemas.android.com/apk/res-auto"
              xmlns:tools="http://schemas.android.com/tools"
              android:layout_width="match_parent"
              android:layout_height="wrap_content"
              android:gravity="center_vertical"
              android:orientation="vertical"
              android:id="@+id/MainFormThirdRow"
              card_view:cardCornerRadius="0dp"
              card_view:cardElevation="0dp"
              card_view:contentPadding="10dp"
              card_view:cardBackgroundColor="@android:color/white"
              android:layout_below="@+id/Divider2">

            <LinearLayout
                xmlns:android="http://schemas.android.com/apk/res/android"
                xmlns:tools="http://schemas.android.com/tools"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

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

                <!--Cycle Name-->  <!--Cycle Stage-->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:orientation="vertical">

                    <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_weight="2"
                    android:gravity="center_vertical"
                    android:orientation="vertical">

                  <!--Cycle Name-->
                  <LinearLayout
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:gravity="center_vertical"
                      android:orientation="vertical">

                    <TextView
                        android:id="@+id/textViewCycleName"
                        style="@style/Base.TextAppearance.AppCompat.Headline"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="Current Cycle Name"
                        android:textColor="#6d6e70"
                        android:textSize="15dp"/>

                    <LinearLayout
                        android:id="@+id/tableRowIOMapping1"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:orientation="horizontal"
                        android:padding="5dp">
                      <!--Cycle Image-->
                      <ImageView
                          android:id="@+id/CycleImage"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:layout_marginRight="10dp">
                      </ImageView>
                      <TextView
                          android:id="@+id/editTextCycleName"
                          style="@style/Base.TextAppearance.AppCompat.Body1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Cycle Value"
                          android:textColor="#ff0000"
                          android:textSize="17dp"
                          android:paddingTop="5dp"
                          android:maxLines="2"
                          android:ellipsize="end"/>
                    </LinearLayout>
                  </LinearLayout>

                  <!--Divider-->
                  <View
                        android:layout_width="match_parent"
                        android:background="@drawable/HalfHorizontalDivider"
                        android:layout_height="1dp"/>

                  <!--Cycle Stage-->
                  <LinearLayout
                      android:layout_width="match_parent"
                      android:layout_height="wrap_content"
                      android:layout_weight="1"
                      android:gravity="center_vertical"
                      android:orientation="vertical">

                    <LinearLayout
                      android:layout_width="match_parent"
                      android:layout_height="match_parent"
                      android:layout_weight="1"
                      android:gravity="center_vertical"
                      android:orientation="vertical">
                      <TextView
                          android:id="@+id/textViewCycleStage"
                          style="@style/Base.TextAppearance.AppCompat.Headline"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Cycle Stage"
                          android:textColor="#6d6e70"
                          android:textSize="15dp"
                          android:gravity="center_horizontal"/>
                      <LinearLayout
                          android:id="@+id/tableRowIOMapping1"
                          android:layout_width="match_parent"
                          android:layout_height="wrap_content"
                          android:layout_weight="1"
                          android:orientation="vertical"
                          android:paddingLeft="30dp">
                        <TextView
                          android:id="@+id/editTextCycleStage"
                          style="@style/Base.TextAppearance.AppCompat.Body1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Cycle Stage Value"
                          android:textColor="#231f20"
                          android:textSize="15dp"
                          android:textStyle="bold"
                          android:ellipsize="end"/>
                        <!--Cycle Image-->
                        <WebView
                            xmlns:android="http://schemas.android.com/apk/res/android"
                             android:id="@+id/MyWebView"
                             android:layout_width="100dp"
                             android:layout_height="100dp"/>
                      </LinearLayout>
                    </LinearLayout>

                  </LinearLayout>

                </LinearLayout>
                </LinearLayout>

                <!--Vertical Divider-->
                <View
                    android:layout_width="1dp"
                    android:layout_height="match_parent"
                    android:background="@drawable/FullVerticalDivider"/>

                <!--System Status-->  <!--Door State-->  <!--Cycle Error-->
                <LinearLayout
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_weight="1"
                    android:orientation="vertical"
                    android:layout_marginLeft="5dp">

                  <LinearLayout
                  android:layout_width="match_parent"
                  android:layout_height="match_parent"
                  android:layout_weight="3"
                  android:gravity="center_vertical"
                  android:orientation="vertical">
                    <!--System Status-->
                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:orientation="vertical"
                        android:layout_weight="1">

                      <TextView
                          android:id="@+id/textViewSystemStatus"
                          style="@style/Base.TextAppearance.AppCompat.Headline"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="System Status"
                          android:textColor="#6d6e70"
                          android:textSize="15dp"/>

                      <TextView
                          android:id="@+id/editTextSystemStatus"
                          style="@style/Base.TextAppearance.AppCompat.Body1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="System Value"
                          android:textColor="#ff0000"
                          android:textSize="20dp"
                          android:padding="5dp"
                          android:maxLines="2"
                          android:ellipsize="end"/>
                    </LinearLayout>

                    <!--Divider-->
                    <View
                          android:layout_width="match_parent"
                          android:background="@drawable/HalfHorizontalDivider"
                          android:layout_height="1dp"/>

                    <!--Door State-->
                    <LinearLayout
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          android:orientation="vertical"
                          android:layout_weight="1">

                      <TextView
                          android:id="@+id/textViewDoorState"
                          style="@style/Base.TextAppearance.AppCompat.Headline"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Door State"
                          android:textColor="#6d6e70"
                          android:textSize="15dp"
                          android:ellipsize="end"
                          android:maxLines="1"/>

                      <TextView
                          android:id="@+id/editTextDoorState"
                          style="@style/Base.TextAppearance.AppCompat.Body1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:text="Door State Value"
                          android:textColor="#ff0000"
                          android:textSize="20dp"
                          android:padding="5dp"
                          android:ellipsize="end"/>
                    </LinearLayout>

                    <!--Divider-->
                    <View
                          android:layout_width="match_parent"
                          android:background="@drawable/HalfHorizontalDivider"
                          android:layout_height="1dp"/>

                    <!--Cycle Error-->
                    <LinearLayout
                          android:layout_width="match_parent"
                          android:layout_height="match_parent"
                          android:orientation="vertical"
                          android:layout_weight="1">

                      <TextView
                          android:id="@+id/textViewCycleError"
                          style="@style/Base.TextAppearance.AppCompat.Headline"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:textColor="#6d6e70"
                          android:textSize="15dp"/>

                      <TextView
                          android:id="@+id/editTextCycleError"
                          style="@style/Base.TextAppearance.AppCompat.Body1"
                          android:layout_width="wrap_content"
                          android:layout_height="wrap_content"
                          android:textColor="#ff0000"
                          android:textSize="20dp"
                          android:padding="5dp"
                          android:ellipsize="end"
                          android:maxLines="1"/>
                    </LinearLayout>

                  </LinearLayout>

                </LinearLayout>

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

Vertical Divider:
     <shape xmlns:android="http://schemas.android.com/apk/res/android" >
        <size android:width="1dp"/>
        <solid android:color="#989898"/>
      </shape>

Horizontal Divider:
      <?xml version="1.0" encoding="utf-8"?>
      <layer-list xmlns:android="http://schemas.android.com/apk/res/android" >
        <item>
          <shape android:shape="rectangle" >
            <solid android:color="@android:color/white" />
          </shape>
        </item>

        <item
            android:left="10dp"
            android:right="10dp">
          <shape android:shape="rectangle" >
            <solid android:color="#989898"/>
          </shape>
        </item>

      </layer-list>

I hope it will be of use.


text:
Q: Can I customise the value components in a case class? Say I have some case class in a library:
case class MyClass(a: Int, b: Int)

Later it turns out that there's a bug in my library and I need to apply some extra logic to one of these parameters to keep things working, so that from the user's perspective instances this can happen:
val x = MyClass(1, 2)
println(x.a)  // prints '3' or whatever I happen to compute for 'a'

In other words, the final value for x.a is not necessarily what was passed in to the constructor. I know this looks crazy, but trust me, I need it. x.a will still return whatever was passed to the constructor in most cases, but there is one value for the constructor parameter that will lead to bugs and I need to transform it.
I see two ways to achieve this. I can make a a var:
case class MyClass(var a: Int, b: Int) {
  a = someComputation()
}

but then the class becomes mutable because a can be set from the outside. My problem would be solved if I could remove or 'hide' the generated setter but it doesn't seem to be possible. If I add
private def a_=(newA: Int) {}

it doesn't override the setter generated by the var so it sees two method definitions and doesn't compile.
The second option is to create a field/method separate from the constructor parameter:
case class MyClass(private val _a: Int, b: Int) {
  val a = someComputation(a)
}

but _a is used in all the special generated methods such as equals, toString, etc, whereas the custom field a doesn't feature.
Is there any way to transform the constructor parameters without affecting the rest of the API?

A: What I'd do, is override the apply method on the companion object to create an instance of MyClass with the right computation.
object MyClass {
   def apply(a: Int, b: Int) = new MyClass(someComputation(a),b))
}

Then you can call it like val x = MyClass(1, 2), but you won't be able to call it like val x = new MyClass(1, 2) if you still want the computation to occur.
Apparently all of the above do not work outside the REPL.
Instead I'd settle on another method on the companion object, it's not as nice a solution, but it should work:
object MyClass {
   def create(a: Int, b: Int) = new MyClass(someComputation(a),b))
}

A: So, you want something like MyClass(a=1).a == 2 to return true?
Do you really need an explanation why it is a bad idea? ;)
Thank god, it is not possible!

redpajama_set_name: RedPajamaStackExchange


text:
Q: Media queries: How to NOT target Ipad I know there is a lot of topics out there about media queries, but tonight I'm stuck on this:
I'm targeting many Smartphones and specifically Samsung Galaxy S3 with this :
@media screen and (max-device-width: 720px), (min-device-width: 721px) { .. }

it works well for both portrtait and landscape! But I don't know why, in this way I am also targeting Ipad landscape mode, which I don't want to! In case I'd rather prefer to target portrait view of Ipad together with smartphones!
To be clear, what I want to achieve is to have 2 versions of a website, default is a layout of max-width 960px and a smaller version that is very good for Smartphones and good for Ipad and other tablets on portrait.. Now the mobile version is working on smartphones but to little on Ipad...
I know that I could target Ipad directly, but I don't want to replicate many css rules that would be the same of desktop!

A: The problem appears to be with the syntax of your media query. You've used a comma instead of and and I think you have max/min around the wrong way. For CSS Media Queries a , is the OR separator whereas AND requires multiple queries to be true.
Your media query should instead look like:
@media screen and (min-device-width: 720px) and (max-device-width: 721px) { .. }
Or written more succinctly you could use the specific device-width:
@media screen and (device-width: 720px) { .. }
Using this method you could target Galaxy S3 portrait and landscape by using the comma, ie:
@media screen and (device-width: 720px), (device-width: 1280px) { .. }


text:
Q: GIT : Handle multiple variations of th same sofware in a single repo My team and I are working on multiple projects at a time, but they all use the same code base, and it needs adaptations for each projects.
So for example, we have the base code, that contains components A and B. For each new project, we have to modify B, but A remains the same.
At the moment, we have one GIT repo for each project, but sometimes we discover an issue in A that we have to fix in all of our projects. So we are considering the possibility to keep all of our projects in the same repo and use branches to manage them in order to simplify the corrections for the common components.
I've been looking for workflows that cover this kind of code management (gitflow, github flow, gitlab flow...) , but I didn't find anything that matches our needs.
Is managing different variants of a codebase in the same repo a bad idea?
If not, is there a workflow out there i may not have found that would suit this kind of application? Or do we just use a standard workflow and treat all project branches as single repos?
Thanks in advance for your help!

A: Dos
Managing multiple versions of the same repo can be a good idea, this depends on the exact codebase, goal and chosen approach. Ideally you want encapsulate core functionality, so that there is a layer which is always the same and then there are high-level layers which are distinct and access the core layer.
There are endless options how you could achieve this, I'd like to briefly mention a few:

*

*Using git: An option is to have the unchanging core functionality in a repository X, then dynamically import this repository in your other project's repositories. A prime example of such functionality is Git Submodules

*

*https://git-scm.com/book/en/v2/Git-Tools-Submodules

*Using dependency injection: Depending on the language of your project there are DI frameworks, such as Dagger 2. You could maintain one singular repository with all your code, then use a DI framework to dynamically load classes with required changes

*

*An example might help: Assume there is a UI class A. This class depends on either model class B or C, depending on which variant of your application you want to build. Both B or C depend on class D which is your unchanging core functionality. In this scenario it's possible to let Dagger handle the dependency injection and provide either B or C

*https://dagger.dev/

*You can use dedicated build tools, such as Gradle or Maven. It's possible to define whole build pipelines, so that you keep all of your codebase in one repository and execute a specific build pipeline depending on what version you intend to build.

*

*https://gradle.org/

*https://maven.apache.org/

*Yet another possibility is using something like Jenkins to define individual build pipelines for each respective application version. This is essentially just a variation of previously mentioned approaches, but with a more generic tool

*

*https://www.jenkins.io/
You will likely need to refactor your codebase to utilize either of these approaches cleanly, however it is well worth it to avoid running into technical debt quickly.
Don'ts
What you do NOT want to do under any circumstances is replicating the codebase with only slight changes and put it wholecloth into distinct repositories.
I have actually seen this approach live and in action - it blows up horribly into your face. You end up maintaining multiple similar but to some degree different codebases. Very likely improvements from A don't always make it into B and vice versa due to time constraints and you end up doing the same work multiple times. It will also be hard to keep track of the state of either codebase.

A: I think the standard behavior of a branch is the means of choice. This can then be used to evolve A and serve as the basis for B.
Have you looked at the concept of tags? This is a way to assign a unique identifier to a commit. If you use this e.g. in A, you can then see in the derived branches on which basis of A your feature B is based.


text:
Q: Is there a cross platform framework that can access sms content for Android, iOS and Windows Phone? We want an easy way to collect examples of sms messages sent from one person to the other. I have gone through a lot of the documentation for frameworks such as Phonegap to see if I can access sms content and Monotouch seems to be the only one that "might" be able to do this on Android and iOS (http://androidapi.xamarin.com/?link=T:Android.Telephony.SmsManager).
I am an Android developer and can easily do this on Android but I don't know the first thing about iOS or WP7 so I was hopping I could just pull the data off those types of devices, parse it some how (like obfuscate the private data) and send it to our service.
It doesn't need to have a beautiful UI or even be an app. It could be a webpage that somehow gets access to the underlying providers.
Jared

A: It is not possible on standard iOS. See this stackoverflow question: How to read sms message on iOS?


text:
Q: Making all pivot tables on one sheet mimic each other in terms of rows expanding and collapsing Alright, I'm new to VBA but I know this has to be possible. I spent a while coding android applications, but I wouldn't call myself nearly an expert, probably not even intermediate to be honest. However, alas, excel doesn't use java. Here's my problem:
All I need is to make 6 other pivot tables on the same sheet mimic what I will call the primary pivot table. The only feature it needs to mimic though (for now I suppose) is when the primary expands/collapses, the others should follow suit.
I'm guessing that the code will be similar to an onclicklistener in java and when the code "hears" a click for a collapse or expansion in the primary pivot table, it just applies that same collapse or expansion to the other six. The other 6 pivots will always have the same row labels, so an error in carrying over the "location" of the click from the primary to the others should never be a problem.
I tried recording the expansion of one of the row labels in my pivot table and got this code back.
ActiveSheet.PivotTables("PivotTable1").PivotFields("Year").PivotItems("2005"). _
    ShowDetail = True

I know though, that this is the coding for executing that expansion (and ShowDetail = False would make it collapse). I think what I'm needing is like I said, a listener to "hear" the click of any expansion/collapse of the primary pivot table, a way to store/carry over information on what row label was clicked (the "location" of the click if you will), and then a generic version of the above code to execute on the other 6 using I'm guessing a for loop of sorts.
Am I on the right track slash any help guys? Thanks a ton as always.

A: This should work for you:
Put this in a standard module(this is the less efficient method - because it checks all fields):
Sub LinkPivotTables_ByFieldItemName_ToShowDetail(pt As PivotTable)

Dim wkb As Workbook
Set wkb = ThisWorkbook

Dim wks As Worksheet
Set wks = wkb.Sheets(1)

Dim PivotTableIndex As Integer
Dim PivotFieldIndex As Integer
Dim PivotItemIndex As Integer

Dim PivotFieldIndexName As String
Dim PivotItemIndexName As String

Dim BoolValue As Boolean

Application.ScreenUpdating = False
Application.EnableEvents = False

On Error Resume Next

    For PivotFieldIndex = 1 To pt.PivotFields.Count

    PivotFieldIndexName = pt.PivotFields(PivotFieldIndex).Name

        For PivotItemsIndex = 1 To pt.PivotFields(PivotFieldIndex).PivotItems.Count

        PivotItemIndexName = pt.PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).Name
        BoolValue = pt.PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).ShowDetail

            For PivotTableIndex = 1 To wks.PivotTables.Count

                ' This If statement will dramatically increase efficiency - because it takes a long long time to set the value but it doesn't take long to check it.
                If wks.PivotTables(PivotTableIndex).PivotFields(PivotFieldIndexName).PivotItems(PivotItemIndexName).ShowDetail <> BoolValue Then
                    wks.PivotTables(PivotTableIndex).PivotFields(PivotFieldIndexName).PivotItems(PivotItemIndexName).ShowDetail = BoolValue
                End If

            Next PivotTableIndex

        Next PivotItemsIndex

    Next PivotFieldIndex

Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub

Then to automatically run this macro on any PivotTable edit you need to put this in your Sheet1 code(let me know if you need help doing that).
Sub Worksheet_PivotTableUpdate(ByVal Target As PivotTable)

    Call LinkPivotTables_ByFieldItemName_ToShowDetail(Target)

End Sub

It will work if all your pivot tables are on sheet one. You might have to copy/paste into wordpad or another text editor first because I didn't worry about line length limits(watch out for word wrap).
EDIT/ADDITION:
This is how you put code on a specific sheet object:

EDIT2/ADDITION2 - EFFICIENCY METHOD:
This method will dramatically increase the efficiency but you will have to tell it specifically which Field you want to be synced up(it won't sync them all):
Sub LinkPivotTables_ByFieldItemName_ToShowDetail(pt As PivotTable)  'takes as argument - pt As PivotTable

Dim wkb As Workbook
Set wkb = ThisWorkbook

Dim wks As Worksheet
Set wks = wkb.Sheets(1)

Dim PivotTableIndex As Integer
Dim PivotItemIndex As Integer
Dim PivotFieldIndex As String
Dim BoolValue As Boolean
Dim ItemName As String

Application.ScreenUpdating = False
Application.EnableEvents = False

PivotFieldIndex = "Year"

On Error Resume Next

        For PivotItemsIndex = 1 To pt.PivotFields(PivotFieldIndex).PivotItems.Count

        BoolValue = pt.PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).ShowDetail
        ItemName = pt.PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).Name

            For PivotTableIndex = 1 To wks.PivotTables.Count

                ' This If statement will dramatically increase efficiency - because it takes a long long time to set the value but it doesn't take long to check it.
                If wks.PivotTables(PivotTableIndex).PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).ShowDetail <> BoolValue Then
                    wks.PivotTables(PivotTableIndex).PivotFields(PivotFieldIndex).PivotItems(PivotItemsIndex).ShowDetail = BoolValue
                End If

            Next PivotTableIndex

        Next PivotItemsIndex

Application.ScreenUpdating = True
Application.EnableEvents = True

End Sub

You will have to manually tell it in this line what field you want synced up:
PivotFieldIndex = "Year"

I've found several other solutions online that use the same looping method to sync up pivot tables - the problem is that they all run into the same efficency problems when you get decent sized pivot tables. These somewhat get around that issue by including an IF statement that checks the Item.ShowDetail value before it sets it(because it takes alot longer to set the value than it does to just check it). Good Luck.


text:
Q: Objects stuck on the edge of Navmesh surface The resulting image
So I have made a Navmesh surface on a plane in unity 3D. The cube will constantly spawn cylinders to get it to move towards the sphere. But the cylinders spawned continue to try to move on the edge of Navmesh surface and as a result, stuck.
I've tried to change the size of the plane but it didn't change anything. I think it might be something wrong with the spawning path but I don't know what it is.
These are the codes for the spawning.
public class EnemySpawner : MonoBehaviour
{
    public GameObject enemy;
    public float SpawnTime = 2f;
    public Transform[] spawnPoints;

    void Start()
    {
        InvokeRepeating("Spawn", SpawnTime, SpawnTime);
    }

    void Spawn()
    {
        int spawnPointIndex = Random.Range(0, spawnPoints.Length);

        Instantiate(enemy, spawnPoints[spawnPointIndex].position, spawnPoints[spawnPointIndex].rotation);
    }
}

These are the codes for the Nav agent
public class EnemyController : MonoBehaviour
{
    public Transform player;
    private UnityEngine.AI.NavMeshAgent agent;

    // Start is called before the first frame update
    void Start()
    {
        agent = GetComponent<UnityEngine.AI.NavMeshAgent>();
    }

    // Update is called once per frame
    void Update()
    {
        agent.destination = player.position;
    }
}

I expect it to move directly towards the sphere, but it's actually trying to move along the edge of NavMesh surface.


text:
Q: Adding Same-site; Secure to Cookies in Classic ASP We are running a classic ASP website, and having issues with Cookies in Chrome browser.  Chrome is enforcing the cookie to be set securely (https://www.chromestatus.com/feature/5633521622188032)
We are setting a cookie as follows:
Response.AddHeader "Set-Cookie", "TestCookie=This is a Test; path=/; SameSite=None; Secure"
Response.Cookies("TestCookie").Expires = Date + 1

However, this has issues with Chrome, where sessions end abruptly when a resource of a different domain is called.
Chrome's cookie details show this:
Send for
Same-site connections only

Note there is no mention of "secure" as I think there should be.
What is the correct way of setting the Cookie in classic ASP for this?

A: There is a problem with your current approach to setting the Response Cookie.
By using Response.Cookies after setting the header using Set-Cookie you are in effect creating a new empty cookie called "TestCookie". Instead, you want to incorporate the expiry into the existing Set-Cookie header.
Testing your code, this is the Response header contents:

<%
Function FormatCookieDateTime(interval, value, tz)
  Dim dt: dt = DateAdd(interval, value, Date())
  Dim tm: tm = Time()
  Dim result: result = WeekDayName(WeekDay(dt), True) & ", " & _
    Right("00" & Day(dt), 2) & "-" & _
    MonthName(Month(dt), True) & "-" & _
    Year(dt) & " " & _
    Right("00" & Hour(Time()), 2) & ":" & _
    Right("00" & Minute(Time()), 2) & ":" & _
    Right("00" & Second(Time()), 2) & " " & tz

  FormatCookieDateTime = result
End Function

Response.AddHeader "Set-Cookie", "TestCookie=This is a Test; path=/; SameSite=None; Secure; expires=" & FormatCookieDateTime("d", 1, "GMT")
%>

Built a function that makes setting the expiry using the correct format easier.
Remember Secure is for Secure Connections
Because you are setting two cookies (one via AddHeader() and one via Response.Cookie) it might not be clear but the first cookie with Secure set will be ignored by chrome if the connection is not using HTTPS. In fact, if you look at the request in Chrome Dev Tools you should see a warning symbol next to the Set-Cookie header that says (when hovered over) something along the lines of;

This set-cookie had the "Secure" attribute but was not received over a secure connection.

A: The standard Response.Cookies method doesn't work reliably with cookies set by using the more low-level Reponse.Addheader. I have experienced the same thing.
I'm not able to test, but you might want to try two things:

*

*don't use these two instructions in the same ASP codeblock. My guess is that setting the cookie using AddHeader() will bypass classic ASP's cookie collection. So Classic ASP will not know that this cookie has been set. What you could try is setting this cookie on one page, sending it to the browser, and on a different page set the expiration.

*Try and set the expiration using the same AddHeader() instruction. You will have to look up how this is done on a header level, but it should certainly be possible.
I have some example code online that sets a secure and HTTPOnly cookie, using Response.AddHeader(), but it doesn't set an expiration, which results in a cookie that expires when the browser(tab) is closed:
https://gitlab.com/erik4/classic-asp-book-examples/-/blob/master/global.asa


text:
Q: How do you manage "pick lists" in a database I have an application with multiple "pick list" entities, such as used to populate choices of dropdown selection boxes. These entities need to be stored in the database. How do one persist these entities in the database?
Should I create a new table for each pick list?  Is there a better solution?

A: In the past I've created a table that has the Name of the list and the acceptable values, then queried it to display the list. I also include a underlying value, so you can return a display value for the list, and a bound value that may be much uglier (a small int for normalized data, for instance)
CREATE TABLE PickList(
    ListName varchar(15),
    Value varchar(15),
    Display varchar(15),
    Primary Key (ListName, Display)
)

You could also add a sortOrder field if you want to manually define the order to display them in.

A: It depends on various things:

*

*if they are immutable and non relational (think "names of US States") an argument could be made that they should not be in the database at all: after all they are simply formatting of something simpler (like the two character code assigned). This has the added advantage that you don't need a round trip to the db to fetch something that never changes in order to populate the combo box.
You can then use an Enum in code and a constraint in the DB. In case of localized display, so you need a different formatting for each culture, then you can use XML files or other resources to store the literals.

*if they are relational (think "states - capitals") I am not very convinced either way... but lately I've been using XML files, database constraints and javascript to populate. It works quite well and it's easy on the DB.

*if they are not read-only but rarely change (i.e. typically cannot be changed by the end user but only by some editor or daily batch), then I would still consider the opportunity of not storing them in the DB... it would depend on the particular case.

*in other cases, storing in the DB is the way (think of the tags of StackOverflow... they are "lookup" but can also be changed by the end user) -- possibly with some caching if needed. It requires some careful locking, but it would work well enough.

A: Well, you could do something like this:
PickListContent

IdList  IdPick  Text
1       1       Apples
1       2       Oranges
1       3       Pears
2       1       Dogs
2       2       Cats

and optionally..
PickList

Id    Description
1     Fruit
2     Pets

A: I've found that creating individual tables is the best idea.
I've been down the road of trying to create one master table of all pick lists and then filtering out based on type.  While it works, it has invariably created headaches down the line.  For example you may find that something you presumed to be a simple pick list is not so simple and requires an extra field, do you now split this data into an additional table or extend you master list?
From a database perspective, having individual tables makes it much easier to manage your relational integrity and it makes it easier to interpret the data in the database when you're not using the application

A: We have followed the pattern of a new table for each pick list.  For example:
Table FRUIT has columns ID, NAME, and DESCRIPTION.
Values might include:
15000, Apple, Red fruit
15001, Banana, yellow and yummy
...
If you have a need to reference FRUIT in another table, you would call the column FRUIT_ID and reference the ID value of the row in the FRUIT table.

A: Create one table for lists and one table for list_options.
 # Put in the name of the list
 insert into lists (id, name) values (1, "Country in North America");

 # Put in the values of the list
 insert into list_options (id, list_id, value_text) values
   (1, 1, "Canada"),
   (2, 1, "United States of America"),
   (3, 1, "Mexico");

A: Two tables.  If you try to cram everything into one table then you break normalization (if you care about that).  Here are examples:

LIST
---------------
LIST_ID (PK)
NAME
DESCR

LIST_OPTION
----------------------------
LIST_OPTION_ID (PK)
LIST_ID (FK)
OPTION_NAME
OPTION_VALUE
MANUAL_SORT

The list table simply describes a pick list.  The list_ option table describes each option in a given list.  So your queries will always start with knowing which pick list you'd like to populate (either by name or ID) which you join to the list_ option table to pull all the options.  The manual_sort column is there just in case you want to enforce a particular order other than by name or value.  (BTW, whenever I try to post the words "list" and "option" connected with an underscore, the preview window goes a little wacky.  That's why I put a space there.)
The query would look something like:

select
  b.option_name,
  b.option_value
from
  list a,
  list_option b
where
  a.name="States"
and
  a.list_id = b.list_id
order by
  b.manual_sort asc

You'll also want to create an index on list.name if you think you'll ever use it in a where clause.  The pk and fk columns will typically automatically be indexed.
And please don't create a new table for each pick list unless you're putting in "relationally relevant" data that will be used elsewhere by the app.  You'd be circumventing exactly the relational functionality that a database provides.  You'd be better off statically defining pick lists as constants somewhere in a base class or a properties file (your choice on how to model the name-value pair).

A: To answer the second question first: yes, I would create a separate table for each pick list in most cases.  Especially if they are for completely different types of values (e.g. states and cities).  The general table format I use is as follows:
id - identity or UUID field (I actually call the field xxx_id where xxx is the name of the table).
name - display name of the item
display_order - small int of order to display.  Default this value to something greater than 1

If you want you could add a separate 'value' field but I just usually use the id field as the select box value.
I generally use a select that orders first by display order, then by name, so you can order something alphabetically while still adding your own exceptions.  For example, let's say you have a list of countries that you want in alpha order but have the US first and Canada second you could say "SELECT id, name FROM theTable ORDER BY display_order, name" and set the display_order value for the US as 1, Canada as 2 and all other countries as 9.
You can get fancier, such as having an 'active' flag so you can activate or deactivate options, or setting a 'x_type' field so you can group options, description column for use in tooltips, etc.  But the basic table works well for most circumstances.

A: Depending on your needs, you can just have an options table that has a list identifier and a list value as the primary key.
select optionDesc from Options where 'MyList' = optionList

You can then extend it with an order column, etc. If you have an ID field, that is how you can reference your answers back... of if it is often changing, you can just copy the answer value to the answer table.

A: If you don't mind using strings for the actual values, you can simply give each list a different list_id in value and populate a single table with :
item_id: int
list_id: int
text: varchar(50)
Seems easiest unless you need multiple things per list item

A: We actually created entities to handle simple pick lists.  We created a Lookup table, that holds all the available pick lists, and a LookupValue table that contains all the name/value records for the Lookup.
Works great for us when we need it to be simple.

A: I've done this in two different ways:
1) unique tables per list
2) a master table for the list, with views to give specific ones
I tend to prefer the initial option as it makes updating lists easier (at least in my opinion).

A: Try turning the question around. Why do you need to pull it from the database? Isn't the data part of your model but you really want to persist it in the database? You could use an OR mapper like linq2sql or nhibernate (assuming you're in the .net world) or depending on the data you could store it manually in a table each - there are situations where it would make good sense to put it all in the same table but do consider this only if you feel it makes really good sense. Normally putting different data in different tables makes it a lot easier to (later) understand what is going on.

A: There are several approaches here.
1) Create one table per pick list. Each of the tables would have the ID and Name columns; the value that was picked by the user would be stored based on the ID of the item that was selected.
2) Create a single table with all pick lists. Columns: ID; list ID (or list type); Name. When you need to populate a list, do a query "select all items where list ID = ...". Advantage of this approach: really easy to add pick lists; disadvantage: a little more difficult to write group-by style queries (for example, give me the number of records that picked value X".
I personally prefer option 1, it seems "cleaner" to me.

A: You can use either a separate table for each (my preferred), or a common picklist table that has a type column you can use to filter on from your application.  I'm not sure that one has a great benefit over the other generally speaking.
If you have more than 25 or so, organizationally it might be easier to use the single table solution so you don't have several picklist tables cluttering up your database.
Performance might be a hair better using separate tables for each if your lists are very long, but this is probably negligible provided your indexes and such are set up properly.
I like using separate tables so that if something changes in a picklist - it needs and additional attribute for instance - you can change just that picklist table with little effect on the rest of your schema.  In the single table solution, you will either have to denormalize your picklist data, pull that picklist out into a separate table, etc.  Constraints are also easier to enforce in the separate table solution.

A: This has served us well:
SQL> desc aux_values;
 Name                                      Type
 ----------------------------------------- ------------
 VARIABLE_ID                               VARCHAR2(20)
 VALUE_SEQ                                 NUMBER
 DESCRIPTION                               VARCHAR2(80)
 INTEGER_VALUE                             NUMBER
 CHAR_VALUE                                VARCHAR2(40)
 FLOAT_VALUE                               FLOAT(126)
 ACTIVE_FLAG                               VARCHAR2(1)

The "Variable ID" indicates the kind of data, like "Customer Status" or "Defect Code" or whatever you need.  Then you have several entries, each one with the appropriate data type column filled in.  So for a status, you'd have several entries with the "CHAR_VALUE" filled in.


text:
Q: Instagram Client-Side (Implicit) Authentication not available? I have searched google and I have seen a lot of related questions and answers on this issue but none of them are clear.
I am trying to use Instagram API and as far as I understand, since I am building a client-side app (VueJS) is not a good idea to store the client_secret on the client.
Based on the Instagram Documentation here it seems that there was a way to use implicit authentication.
The problem is that after Facebook took over Instagram and launched the Instagram Graph API it seems that there is no way to use implicit authentication.
Does anyone have any information regarding this? The only solution is to build a server-side app for authentication?

A: This can be solved using an access token.
This token can be generated and has to be refreshed at least every 60 days using a GET request and your app-secret.
This can either be done automatically, in that case with a server side application or by hand.
Source: facebook developer guide
If it helps I created a snippet for vue after wasting the better half of an afternoon on this matter.
You can find it here: https://gitlab.com/snippets/1957175


text:
Q: how to convert a near orthogonal-edge polygon to a mimum inbounding orthogonal-edge polygon? Let's consider there is a polygon with near orthogonal edges that is in the range of (70, 89)° or (91, 110)°. We know the sum of angles in a polygon is multiple of 180°.
The question is how to convert a polygon with customized shape to a minimum polygon with right angles.
As a very simple case, let's consider the example below:

What we want to achieve is, the polygon below:

The number of edges can be more. The example above is just a simple example.


text:
Q: Changing column name in EF forces migration (even with Column attribute) I've created some classes in C# using database-first approach and I am currently refactoring these classes to make the names more human readable.
However, changing the name of the property and applying the original in the ColumnAttribute still forces a migration.
This seems to apply when I rename composite keys that are referenced by other entities/tables.
For example, changing this:
    [Key]
    [Column("SCHED_NAME", Order = 0)]
    [StringLength(120)]
    public string SCHED_NAME { get; set; }

to:
    [Key]
    [Column("SCHED_NAME", Order = 0)]
    [StringLength(120)]
    public string SchedulerName { get; set; }

creates a migration like this one:
        DropForeignKey("dbo.QRTZ_TRIGGERS", new[] { "SCHED_NAME", "JOB_NAME", "JOB_GROUP" }, "dbo.QRTZ_JOB_DETAILS");
        CreateTable(
            "dbo.QRTZ_TRIGGERS",
            c => new
                {
                    SCHED_NAME = c.String(nullable: false, maxLength: 120),
                    TRIGGER_NAME = c.String(nullable: false, maxLength: 150),
                    TRIGGER_GROUP = c.String(nullable: false, maxLength: 150),
                    JOB_NAME = c.String(nullable: false, maxLength: 150),
                    JOB_GROUP = c.String(nullable: false, maxLength: 150),
                    DESCRIPTION = c.String(maxLength: 250),
                    NEXT_FIRE_TIME = c.Long(),
                    PREV_FIRE_TIME = c.Long(),
                    PRIORITY = c.Int(),
                    TRIGGER_STATE = c.String(nullable: false, maxLength: 16),
                    TRIGGER_TYPE = c.String(nullable: false, maxLength: 8),
                    START_TIME = c.Long(nullable: false),
                    END_TIME = c.Long(),
                    CALENDAR_NAME = c.String(maxLength: 200),
                    MISFIRE_INSTR = c.Int(),
                    JOB_DATA = c.Binary(),
                })
            .PrimaryKey(t => new { t.SCHED_NAME, t.TRIGGER_NAME, t.TRIGGER_GROUP })
            .ForeignKey("dbo.QRTZ_JOB_DETAILS", t => new { t.SCHED_NAME, t.JOB_NAME, t.JOB_GROUP });

        CreateTable(
            "dbo.QRTZ_JOB_DETAILS",
            c => new
                {
                    SCHED_NAME = c.String(nullable: false, maxLength: 120),
                    JOB_NAME = c.String(nullable: false, maxLength: 150),
                    JOB_GROUP = c.String(nullable: false, maxLength: 150),
                    DESCRIPTION = c.String(maxLength: 250),
                    JOB_CLASS_NAME = c.String(nullable: false, maxLength: 250),
                    IS_DURABLE = c.Boolean(nullable: false),
                    IS_NONCONCURRENT = c.Boolean(nullable: false),
                    IS_UPDATE_DATA = c.Boolean(nullable: false),
                    REQUESTS_RECOVERY = c.Boolean(nullable: false),
                    JOB_DATA = c.Binary(),
                })
            .PrimaryKey(t => new { t.SCHED_NAME, t.JOB_NAME, t.JOB_GROUP });

        DropTable("dbo.QRTZ_TRIGGERS");
        DropTable("dbo.QRTZ_JOB_DETAILS");
    }

The CreateTable statement is identical to the initial one.
Any ideas why this happens?

A: If you want human readable names to appear on your application, you will need to change the names inside Column() attribute. What you're trying to do above is changing the actual names of the column. Check below how I changed a name to desired name inside Column() attribute but kept original name as it is -
[Key]
[Column("SchedulerName", Order = 0)]
[StringLength(120)]
public string SCHED_NAME { get; set; }


text:
Q: Sum of series involving binomial coefficients Evaluate the following;
$$\sum_{r=0}^{50} (r+1) ^{1000-r}C_{50-r}$$
Using $^{n}C_{r}=^{n}C_{n-r}$ we get $\sum_{r=0}^{50} (r+1) ^{1000-r}C_{950}$
but I am not getting how to solve $\sum_{r=0}^{50} r \cdot \hspace{0.5 mm} ^{1000-r}C_{950}$

A: $\displaystyle  \sum^{50}_{r=0}r\cdot \binom{1000-r}{950}=0\cdot \binom{1000}{950}+1\cdot \binom{999}{950}+2\cdot \binom{998}{950}+\cdots \cdots \cdots +50\cdot \binom{950}{950}$
Using $\displaystyle \binom{n}{k} = $ Coefficients of $x^k$ in $(1+x)^n$
so  coefficients of
$\displaystyle x^{950}$ in
$\displaystyle 1\cdot (1+x)^{999}+2\cdot (1+x)^{998}+3\cdot (1+x)^{997}+\cdots \cdots +50 \cdot (1+x)^{950}$
let $S=1\cdot (1+x)^{999}+2\cdot (1+x)^{998}+3\cdot (1+x)^{997}+\cdots \cdots +50 \cdot (1+x)^{950}\cdots \cdots (\star)$
multiply both side by $\displaystyle \frac{1}{1+x}$
$\displaystyle S\cdot \frac{1}{1+x}=1\cdot (1+x)^{998}+2\cdot (1+x)^{997}+\cdots+49 \cdot (1+x)^{949}+50\cdot (1+x)^{949}\cdots \cdots (\star \star)$
So $\displaystyle \bigg(1-\frac{1}{1+x}\bigg) = (1+x)^{999}+(1+x)^{998}+\cdots \cdots (1+x)^{949}-50(1+x)^{949}$
So $\displaystyle S \cdot \frac{x}{1+x} = \frac{(1+x)^{1000}-(1+x)^{950}}{1+x-1}-50(1+x)^{949}$
So $\displaystyle S = \frac{(1+x)^{1001}-(1+x)^{951}}{x^2}-\frac{50(1+x)^{950}}{x}$
So coefficients of $x^{950}$ in $\displaystyle  \frac{(1+x)^{1001}-(1+x)^{951}}{x^2}-$ coefficient of $x^{950}$ in $\displaystyle \frac{50(1+x)^{950}}{x}$
So coefficients of $x^{952}$ in $\bigg((1+x)^{1001}-(1+x)^{951}\bigg)-$ coefficients of $x^{951}$ in $(1+x)^{950}$
So we are getting $\displaystyle = \binom{1001}{952}$

A: Set $50-r=u$
$$\sum_{u=0}^{50}(51-u)\binom{950+u}{950}=\sum_{u=0}^{50}\{1002-(951+u)\}\binom{950+u}{950}$$
$$=1002\sum_{u=0}^{50}\binom{950+u}{950}-951\sum_{u=0}^{50}\binom{951+u}{951}$$
Now $\displaystyle\sum_{u=0}^{50}\binom{950+u}{950}$  is the coefficient of $x^{950}$ in $$\displaystyle\sum_{u=0}^{50}(1+x)^{950+u}$$

A: This is a hockey stick made of hockey sticks. Expand each term $(r+1)\binom{1000-r}{950}$ into a column of $r+1$ copies of $\binom{1000-r}{950}$, then add up the rows using the hockey stick identity, then add up the rows sums using the hockey stick identity.
$$\begin{array}{rrrcrl}
\displaystyle\binom{1000}{950}&+\displaystyle2\binom{999}{950}&+\displaystyle3\binom{999}{950}&\dots&+\displaystyle50\binom{950}{950}\\\hline\\
=\displaystyle\binom{1000}{950}&+\displaystyle\binom{999}{950}&+\displaystyle\binom{999}{950}&\dots&+\displaystyle\binom{950}{950} &\stackrel{\text{H.S.}}=\displaystyle\binom{1001}{951}
\\\\ & +\displaystyle\binom{999}{950}&+\displaystyle\binom{998}{950}&\dots &+\displaystyle\binom{950}{950}
&\stackrel{\text{H.S.}}=+\displaystyle\binom{1000}{951}
\\\\ &&+\displaystyle\binom{998}{950}&\dots &+\displaystyle\binom{950}{950}
&\stackrel{\text{H.S.}}=+\displaystyle\binom{999}{951}
\\\\&&&\ddots&\vdots\;\;\;\;&\;\;\;\;\;\;\;\;\;\;\;\vdots
\\\\&&&&+\displaystyle\binom{950}{950}&\stackrel{\text{H.S.}}=+\displaystyle\binom{951}{951}
\\\\
&&&&&\stackrel{\text{H.S.}}=\displaystyle\boxed{\binom{1002}{952}}
\end{array}$$


text:
Q: Use of simulation in explanatory versus predictive models I understand the important distinction between explanatory vs. predictive models. However, I often read that simulations is an important tool in risk modelling and risk analysis. How are simulations used in explanatory modelling and in predictive modelling?
I imagine that with predictive models, you may want to obtain a distribution of potential outcomes therefore rely on simulations. Is that correct? I can't figure out where simulations happen in explanatory modelling.
Thanks for any pointers.

A: Wait, are we speaking of potential outcomes in prediction settings?
Potential outcomes are strictly related to a notion of causality. I will try to answer you, assuming that your explanatory models aim to estimate causal effects. I am not repeating the potential outcome model here, as you can find plenty of explanations online, or in academic textbooks (I highly recommend Imbens and Rubin, 2015), academic papers, or even here or here on CV.
So, simulation designs are implemented in order to investigate how different estimators (or models, or what not) perform in finite samples. Let me fastly digress on this. Usually, the main theoretical properties of estimators concern their performance as the sample size grows. In general, we get that the precision and the accuracy improve as the number of data instances ($N$ henceforth) gets larger and larger. These asymptotic properties hold for $N \rightarrow + \infty$. The concern is that it is not clear how many data points suffice in order to ensure that these properties hold, as we work with a finite $N$, i.e., with finite samples.
Hence the purpose of the simualtions. By repeatedly drawing data from the same joint distribution, and applying the estimator(s) of interest, we can analyze the finite-sample behaviour of the model(s) of interest. Clearly, usually more simualtion designs are implemented, varying the sample size, the data generating process, and what not. The idea is to understand how our estimators would behave under different circumnstances.
In prediction settings, I would say that simulation scenarios may be less worthy, as we always have the true outcomes, hence we are always able to compute test errors. By contrast, in causal analysis, the treatment effects are never observed, as we observe at most a potential outcome for each unit (what Holland, 1986, calls the fundamental problem of causal inference). Here simulating data is crucial. By doing so, we specify the data generating process of the causal effects, hence we act as if we know the "ground truth", thus being able to compute test errors. In this way, we understand whether a given model (or estimator) is able to recover the unobserved truth.


text:
Q: Subversion for Shell-Script management in a Datacenter Environment i work as a datacenter administrator with a ton of linux servers and we have about 200 shell scripts to manage applications and systems. At the moment we use RCS as versioning for our scripts but as our DC team is getting larger and larger this is no longer a usable way to go. I thought about SVN to centralise this and keep track of changes, my plan is to do this as following:
One Repository called "DC" with a subfolder for every script/program in trunk, all admins do their changes in  trunk and check in/out the single folders containing the scripts.
One branch named "testing", if a change is done and ready to test, users have to export the subfolder to "testing", our testing environment will automatically download the HEAD revision of the scripts from the testing branch via cronjobs.
A second branch called "stable", if the scripts are tested, the user have to move the script from "testing" to "stable" where all productive servers update the scripts periodically via cronjob from the "stable" branch.
I'm rather new to SVN and want to know if this is a possible way to go?
How do you guys use SVN as a VCS for Shell Scripts, AFAIK i can not work with single files in SVN, that's why i use a subfolder for every shell script named same as the script without the .sh extension. One Repo for every script would be some kind of overkill IMO, people would have to check in/out multiple repos, switch between them and so on.
Kind Regards


text:
Q: Conflict of VPN allocated IP address In my work place, my allocated private IP is 192.168.2.10, and I need to use VPN (PPTP) to another network, which also allocate IP in the same subnet, e.g. (192.168.2.20).
What are the best way to get around this problem?
I am using Mac.

A: If you don't have a way to get either your work network or the network at the other end of your VPN link to renumber to a different private subnet, then you've got a problem because your work Mac will get confused by the subnet conflict between its local subnet and the VPN-remote subnet.
A sneaky way to work around that problem might be to shield your Mac from seeing the 192.168.2.0/24 subnet at work, by putting your Mac behind an extra NAT.
Take any cheap home gateway router and plug it into your work network in your office. Give it your work-assigned 192.168.2.10 IP address on its WAN port (make sure to tell it about the correct subnet mask and default gateway router for your work network).  Configure it to do NAT, and to use some other subnet (say 10.0.1.0/24) on the private side of the NAT.  Connect your Mac to the private side of this NAT box, and let it get a 10.0.1.x address.  Make sure your Mac has no other wired or wireless connections to your work's 192.168.2.0/24 network.
Now your Mac should be able to make the VPN connection.


text:
Q: Return compound structure from getter method in DTO Suppose the following DTO class. Which of the two getters breaks encapsulation least?
class Foo
    {
    public:
        /*Return the most primitive type. Caller do not need
        to worry about what Array is*/
        const RecType* dataBeginGet() const;
        const RecType* dataEndGet() const;

        /*Return a reference to the Array.
         Caller do not need to call two methods before iteration
        */
        const Array<RecType>& dataGet() const
            {return m_data;}

    private:
        Array<RecType> m_data;
    };


text:
Q: Too many hamburgers and not enough space for icons This is how the new responsive design looks on a narrow screen when you have a lot of stuff going on in the top bar:

This is how it looks when you narrow the screen a bit:

The help and the review icons are gone now. Which is the expected behaviour for a responsive design, and as I'm familiar with this concept, I'd simply look into the hamburger menu that contains the overflow menu items.
There are several issues with this in the new SE design. There isn't a single hamburger menu here, there are three of them (credit goes to Sklivvz for noticing this first and pointing me towards this issue).
Well, two of them look a bit like the SE logo, but they're still very similar in design to a hamburger menu, and ones of them actually works similar to one. And the other issue is that not a single one of those three hamburger menus actually contains the overflowing top bar items. As far as I can tell, the icons that are hidden due to a lack of space simply disappear, there is no way to reach them in this case.
How is a new user supposed to understand how this works? Any why are the overflow items not present in any of the hamburger menus, there are certainly enough of them?


text:
Q: Meaning of "Nothing is working here like the rest of the world?" I would like to know whether this phase has negative impact or it can be positive.

A: First of all it's not an English expression but merely a sentence where a small place is compared to a bigger place.
I believe it implies a negative meaning, and I am not sure if it would have any impact at all unless you think it would.
It would be great if you could provide a proper context, in which you intend to use this.

A: The way you have written it – on its own, absent of any context – it is very ambiguous.
I can think of at least two possible meanings:
Let's say a computer virus is wreaking havoc on the computers that control the financial markets.  A troubleshooter in Amsterdam is on the phone with someone in Bombay, who says, "Nothing is working here like the rest of the world," meaning, "Our computers are down, just like everyone else's."
Or maybe someone is visiting a state-of-the-art manufacturing plant, marveling at the efficiency of the operations.  The plant manager proudly proclaims, "Nothing is working here like the rest of the world," meaning, "This plant is very modern; it incorporates some advanced technologies and innovative practices that no one else is using."
It's worth noting that neither of these uses is particularly positive or negative; in both cases, the speaking is merely stating factual information.


text:
Q: Knockout re render template with new data model on change event of dropdown menu I am using knockout native templating to render a template on a page with some sample data.
The following code loads the sample data with template on a page
my.vm = {
   load: function () {
        $.each(my.sampleData.data.sections, function (i, p) {
             // Sample Data Loading Happens HERE
             // I wish to load different sample data on on-click
             // event of  #sampledata dropdown menu. The template
             // should re render without a page refresh.
             // Sample data is stored in db, have to get that using
             // AJAX request
         });
     }
 }; // End of My.VM

 my.vm.load();
 ko.applyBindings(my.vm);

The following is drop-down menu, on click, the data update should happen
<select id="sampledata">
  <option value="637">Sample Data 1</option>
  <option value="697">Sample Data 2</option>
  <option value="646">Sample Data 3</option>
</select>

Response of the following code have the new data, but when i apply bindings with that data, the binding is failing
  $('#sampledata').on('change', function (){
       var cvid = $(this).val();

              jQuery.post(
                MyAjax.ajaxurl,
                {
                    action : 'getpost',
                    cvid : cvid

                },
                function( response ) {
                //Response now have new data
                 my.vm.load();
                           //But the apply bindings is not working for new data
                 ko.applyBindings(response);

                  }
              );

       });

A: Depending on what data you have coming back from AJAX, you should just have .observable() or .observableArray() properties on your viewModel. On return of the AJAX call just set your viewModel properties\array to the new data. All references to the observable() properties will be 'automagically' updated
By declaring your viewModel properties as observable you do not need to 'reapply' bindings.

A: You should call ko.applyBindings only once (preferably during initialization), not every time you load new data. You'll get an error if you call it more than once on the same DOM section.
Read about the options binding for dealing with <select> elements; it's a good idea to handle as much of your interaction with your user interface through Knockout itself rather than using jQuery to manually manipulate the DOM and set handlers.


text:
Q: How is it possible to repeatedly read from a NamedPipe in Windows? How is it possible to repeatedly read from a NamedPipe in Windows? I get an 109 error, saying it could not open pipe, if I have a ReadFile() function after another ReadFile() function.

A: of course this is possible and need do after your pipe is connected and until disconnect. 109 this is ERROR_BROKEN_PIPE - you got this error in ReadFile when another end is close pipe handle, by call CloseHandle. in this case you need call DisconnectNamedPipe and then wait for new client by call ConnectNamedPipe. after connection is complete - you need just call ReadFile , in read completion again call ReadFile and so on until disconnect - some error returned. if you got error ERROR_PIPE_NOT_CONNECTED in ReadFile (just or in completion) this mean that remote end call DisconnectNamedPipe - your pipe already disconnected, so you can skip call to DisconnectNamedPipe and just call ConnectNamedPipe.


text:
Q: WPF ObservableCollection hasn't updated when DataContext has changed I have Data = new ObservableCollection<DATA>(dataContext.DATA);
dataContext is my Entities. DATA is SQL Server table.
Now I run Import method, which fills DATA table on SQL Server:
    public static void Import(DataTable table)
    {
        var dataContext = DataContext.Instance.Entities;

        foreach (DataRow row in table.Rows)
        {
            .......

            var dataRow = new DATA
            {
               .........
            };

            dataContext.AddToDATA(dataRow);
        }
        dataContext.SaveChanges();
    }

But my ObservableCollection Data is still empty. How do I update it?

A: ObservableCollection<T> Constructor (IEnumerable<T>):

Initializes a new instance of the ObservableCollection class that
  contains elements copied from the specified collection.

The keyword here is that it copies the element from the collection. After that it does not retain any synchronization with the enumeration that you passed in. Your code is updating the dataContext object, not your Data object (The ObservableCollection). You will either have to build out your own synchronized version of ObservableCollection or create methods to keep them in sync.
If you aren't concerned with keeping the dataContext object synchronized and only wanted to use it in the one-time load, then you have to have all the appropriate objects in that enumeration before using it in the constructor of your ObservableCollection.
My guess is you do something similar to the following:
Data = new ObservableCollection<DATA>(dataContext.DATA)

// Afterwards...
Import(foobar);

It should be:
Import(foobar);

// Afterwards...
Data = new ObservableCollection<DATA>(dataContext.DATA)

A: You need to reget the data from the datacontext and add it to the observable collection at that point.
public static void Import(DataTable table)
{
    var dataContext = DataContext.Instance.Entities;

    foreach (DataRow row in table.Rows)
    {
        .......

        var dataRow = new DATA
        {
           .........
        };

        dataContext.AddToDATA(dataRow);
    }
    dataContext.SaveChanges();

    var data = datContext.whateverretreval();

    Data = data;
}


text:
Q: Pygame window freezes when using threads I have a pygame script that starts up with a white screen and then transitions to a black screen when the user types something. The user input is handled by another thread and I used queue.Queue to pass messages from the input thread to the pygame one.
The problem is that whenever I run the script the pygame window will freeze after a short while. If I type in something quickly the screen will change from white to black but the window still freezes. I'm not sure where the script gets stuck?
import pygame
import threading
import queue

q = queue.Queue()

pygame.init()

#rgb codes
black = (0, 0, 0)
white = (255, 255, 255)

game_display = pygame.display.set_mode((800, 800))

def screen_1():

    crashed = False

    #holds messages from input thread
    msg = ''

    game_display.fill(white)

    while not crashed:

        #check if there are any messages in the queue
        try:
            msg = q.get(False)
        except queue.Empty:
            pass

        if msg:
            return screen_2()

        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                crashed = True

        pygame.display.update()

def screen_2():

    crashed = False

    game_display.fill(black)

    while not crashed:

        for event in pygame.event.get():
            if event.type == pygame.QUIT:
                crashed = True

        pygame.display.update()

def inputFunc():
    msg = input('Type something:\n')
    q.put(msg)

t1 = threading.Thread(target = screen_1)
t2 = threading.Thread(target = inputFunc)

t1.start()
t2.start()

A: Ok I just figured out that running the pygame bit in a thread causes the window to freeze. If I only create a thread for inputFunc and call screen_1 everything works just fine.


text:
Q: Fetch single layer from image repository using docker or other tooling? Our build creates temporary images which we store to the repository for caching purposes as subsequent images are relying on them.
The images are untagged afterwards. The layer ID I can get from the build log.
But as they might contain credentials in some layers (set in Dockerfile via "ENV API_KEY=$API_KEY) I just want to fetch these layers and make sure that nobody can extract the credentials.
Is there an easy way of doing so?

A: I am unsure if you are actually referencing whole image ID or single layer ID. Usually you should see whole digest of image as well. With whole image digest you can do following. Also final steps can be done for single layers if you don't know specific layer of configuration file layer.
But in general, this depends on the manifest schema version. With schema version 1, you can see environment variables on manifest. With schema version 2 it is two step process. Examples are based on Docker Hub registry, but same API is applied elsewhere.
In both cases, you need authentication token at first, which can be acquired:
curl -sSL "https://auth.docker.io/token?service=registry.docker.io&scope=repository:<repository>:pull" > auth.json

Then pull manifest in version 1 schema and get history section which contains environment variables:
curl --request GET -sLH "Authorization: Bearer `jq -r '.token' auth.json`" -H "Accept: application/vnd.docker.distribution.manifest.v1+json"" "https://index.docker.io/v2/<repository>/manifests/latest" | jq ".history"

Manifest v2 schema uses different Accept header and is more supported in these days and provides more information:
curl --request GET -sLH "Authorization: Bearer `jq -r '.token' auth.json`" -H "Accept: application/vnd.docker.distribution.manifest.v2+json" "https://index.docker.io/v2/<repository>/manifests/latest"

On response there is config section:
"config": {
      "mediaType": "application/vnd.docker.container.image.v1+json",
      "size": 5802,
      "digest": "sha256:2ff217b387d7bbc0ad3fb1cbb2cdae9f7e562f26065f847a1b69964fcb71108"
   }

And finally download whole blob:
curl --request GET -LOH "Authorization: Bearer `jq -r '.token' auth.json`" "https://index.docker.io/v2/<repository>/blobs/sha256:2ff217b387d7bbc0ad3fb1cbb2cdae9f7e562f26065f847a1b69964fcb71108"

See contents of whole configuration file which contains environment variables with included history:
jq . sha256:2ff217b387d7bbc0ad3fb1cbb2cdae9f7e562f26065f847a1b69964fcb71108


text:
Q: Date picker Issue in IOS I have a textfield in which the user can click which opens the date picker and after selection and clicking done button it paste date in textfield. But, i'm facing an issue that my date picker is not showing when i click the textfield, I'm confused why  is it so my code is i think alright but i don't know why it s not showing date picker, My code is ,
datepicker=[[UIDatePicker alloc]init];
datepicker.datePickerMode=UIDatePickerModeDate;

UIToolbar *toolBar=[[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 44)];
[toolBar setTintColor:[UIColor blackColor]];
UIBarButtonItem *doneBtn=[[UIBarButtonItem alloc]initWithTitle:@"Done" style:UIBarButtonItemStylePlain target:self action:@selector(ShowSelectedDate)];
UIBarButtonItem *space=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:self action:nil];
[toolBar setItems:[NSArray arrayWithObjects:doneBtn,space,nil]];

The method is this,
-(void)ShowSelectedDate{
    NSDateFormatter *fromatter=[[NSDateFormatter alloc]init];
    [fromatter setDateFormat:@"dd/mm/yyyy"];
    self.DOB.text=[NSString stringWithFormat:@"%@",[fromatter stringFromDate:datepicker.date]];
}

A: You are missing only one statement
[myTextField setInputView: datepicker];

You are not adding picker to view
[self.view addSubview:datepicker];

To show toolbar you are missing below statement
textField.inputAccessoryView = toolbar;

A: AS @Fahim said
[myTextField setInputView: datepicker];
[self.view addSubview:datepicker];

But your toolbar will do problem here. Because you have harcoded it's height and width.
Picker has default height of 216 as far as I know. So, use tollbar like this
UIToolbar *toolBar=[[UIToolbar alloc]initWithFrame:CGRectMake(0, self.view.frame.size.height - 216 - 44, self.view.frame.size.width, 44)]; // -44 is for tollbar height
[self.view addSubview:toolbar];

Hope it helps you