text:
Q: Android Studio - I cannot see elements I made inside ScrollView, why? Well, I made ScrollView and inside it, I put one LinearLayout. Inside that LinearLayout, I put multiple LinearLayouts and it does not show any error. Also, as you can see image, you can see their shape and that they are constrained. But I cannot see source/background of the ImageViews and TextViews neither within Android Studio nor when I buil app, why?
img1
Here is my xml code:
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/background1_1"
    tools:context=".MainActivity">

    <ImageView
        android:id="@+id/stol"
        android:layout_width="0dp"
        android:layout_height="210dp"
        android:layout_marginTop="8dp"
        android:background="@drawable/stol"
        android:scaleType="centerCrop"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintHorizontal_bias="1.0"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/naslov" />

    <TextView
        android:id="@+id/naslov"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:fontFamily="@font/bangers"
        android:text="POKER CHANCE CALCULATOR"
        android:textAlignment="center"
        android:textColor="#FFFFFF"
        android:textSize="36sp"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent" />

    <LinearLayout
        android:id="@+id/table_cards"
        android:layout_width="0dp"
        android:layout_height="58dp"
        android:layout_marginStart="50dp"
        android:layout_marginTop="50dp"
        android:layout_marginEnd="50dp"
        android:layout_marginBottom="50dp"
        android:orientation="horizontal"
        app:layout_constraintBottom_toBottomOf="@+id/stol"
        app:layout_constraintEnd_toEndOf="@+id/stol"
        app:layout_constraintStart_toStartOf="@+id/stol"
        app:layout_constraintTop_toTopOf="@+id/stol">

        <ImageView
            android:id="@+id/table_card1"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginEnd="10dp"
            android:layout_weight="1"
            android:background="@drawable/backside" />

        <ImageView
            android:id="@+id/table_card2"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:layout_marginEnd="10dp"
            android:layout_weight="1"
            android:background="@drawable/backside" />

        <ImageView
            android:id="@+id/table_card3"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:layout_marginEnd="10dp"
            android:layout_weight="1"
            android:background="@drawable/backside" />

        <ImageView
            android:id="@+id/table_card4"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:layout_marginEnd="10dp"
            android:layout_weight="1"
            android:background="@drawable/backside" />

        <ImageView
            android:id="@+id/table_card5"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="10dp"
            android:layout_weight="1"
            android:background="@drawable/backside" />

    </LinearLayout>

    <ScrollView
        android:id="@+id/scroll_view"
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/stol">

        <!--
        Početak vanjskog sloja!
    -->
        <LinearLayout
            android:id="@+id/linear_vanjski_sloj"
            android:layout_width="0dp"
            android:layout_height="0dp"
            android:orientation="vertical"
            android:weightSum="1"
            app:layout_constraintBottom_toBottomOf="@+id/scroll_view"
            app:layout_constraintEnd_toEndOf="@+id/scroll_view"
            app:layout_constraintStart_toStartOf="@+id/scroll_view"
            app:layout_constraintTop_toTopOf="@+id/scroll_view">

            <LinearLayout
                android:id="@+id/linear_first_row"
                android:layout_width="410dp"
                android:layout_height="194dp"
                android:layout_marginTop="32dp"
                android:gravity="center_horizontal"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/stol">

                <LinearLayout
                    android:id="@+id/linear_player1"
                    android:layout_width="159dp"
                    android:layout_height="180dp"
                    android:layout_marginStart="20dp"
                    android:layout_marginEnd="20dp"
                    android:background="@drawable/okvir"
                    android:orientation="vertical"
                    android:weightSum="1"
                    tools:layout_editor_absoluteX="50dp"
                    tools:layout_editor_absoluteY="338dp">

                    <TextView
                        android:id="@+id/player1_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:elegantTextHeight="true"
                        android:fontFamily="@font/bangers"
                        android:gravity="center"
                        android:text="PLAYER 1"
                        android:textAlignment="center"
                        android:textColor="#ffffff"
                        android:textSize="24sp" />

                    <LinearLayout
                        android:id="@+id/linear_player1_2"
                        android:layout_width="144dp"
                        android:layout_height="103dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:orientation="horizontal">

                        <ImageView
                            android:id="@+id/player2_card1"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="7dp"
                            android:layout_marginEnd="7dp"
                            android:layout_weight="1"
                            android:src="@drawable/backside" />

                        <ImageView
                            android:id="@+id/player2_card2"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="7dp"
                            android:layout_marginEnd="7dp"
                            android:layout_weight="1"
                            android:src="@drawable/backside" />
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/linear2_stats"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginBottom="5dp"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/win_stats2"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="WIN\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />

                        <TextView
                            android:id="@+id/draw_stats2"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="TIE\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />

                        <TextView
                            android:id="@+id/lose_stats2"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="LOSE\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />
                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/linear_player2"
                    android:layout_width="159dp"
                    android:layout_height="180dp"
                    android:layout_marginStart="20dp"
                    android:layout_marginEnd="20dp"
                    android:background="@drawable/okvir"
                    android:orientation="vertical"
                    android:weightSum="1"
                    tools:layout_editor_absoluteX="240dp"
                    tools:layout_editor_absoluteY="305dp">

                    <TextView
                        android:id="@+id/player2_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:elegantTextHeight="true"
                        android:fontFamily="@font/bangers"
                        android:gravity="center"
                        android:text="PLAYER 2"
                        android:textAlignment="center"
                        android:textColor="#ffffff"
                        android:textSize="24sp" />

                    <LinearLayout
                        android:id="@+id/player2_2"
                        android:layout_width="144dp"
                        android:layout_height="103dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:orientation="horizontal">

                        <ImageView
                            android:id="@+id/player1_card1"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="7dp"
                            android:layout_marginEnd="7dp"
                            android:layout_weight="1"
                            android:src="@drawable/backside" />

                        <ImageView
                            android:id="@+id/player1_card2"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="7dp"
                            android:layout_marginEnd="7dp"
                            android:layout_weight="1"
                            android:src="@drawable/backside" />
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/linear1_stats"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginBottom="5dp"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/win_stats1"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="WIN\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />

                        <TextView
                            android:id="@+id/draw_stats1"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="TIE\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />

                        <TextView
                            android:id="@+id/lose_stats1"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="LOSE\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />
                    </LinearLayout>

                </LinearLayout>

            </LinearLayout>

            <LinearLayout
                android:id="@+id/linear_second_row"
                android:layout_width="410dp"
                android:layout_height="194dp"
                android:layout_marginTop="32dp"
                android:gravity="center_horizontal"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/stol">

                <LinearLayout
                    android:id="@+id/linear_player3"
                    android:layout_width="159dp"
                    android:layout_height="180dp"
                    android:layout_marginStart="20dp"
                    android:layout_marginEnd="20dp"
                    android:background="@drawable/okvir"
                    android:orientation="vertical"
                    android:weightSum="1"
                    tools:layout_editor_absoluteX="50dp"
                    tools:layout_editor_absoluteY="338dp">

                    <TextView
                        android:id="@+id/player3_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:elegantTextHeight="true"
                        android:fontFamily="@font/bangers"
                        android:gravity="center"
                        android:text="PLAYER 3"
                        android:textAlignment="center"
                        android:textColor="#ffffff"
                        android:textSize="24sp" />

                    <LinearLayout
                        android:id="@+id/linear_player2_1"
                        android:layout_width="144dp"
                        android:layout_height="103dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:orientation="horizontal">

                        <ImageView
                            android:id="@+id/player3_card1"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="7dp"
                            android:layout_marginEnd="7dp"
                            android:layout_weight="1"
                            android:src="@drawable/backside" />

                        <ImageView
                            android:id="@+id/player3_card2"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="7dp"
                            android:layout_marginEnd="7dp"
                            android:layout_weight="1"
                            android:src="@drawable/backside" />
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/linear3_stats"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginBottom="5dp"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/win_stats3"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="WIN\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />

                        <TextView
                            android:id="@+id/draw_stats3"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="TIE\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />

                        <TextView
                            android:id="@+id/lose_stats3"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="LOSE\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />
                    </LinearLayout>

                </LinearLayout>

                <LinearLayout
                    android:id="@+id/linear_player4"
                    android:layout_width="159dp"
                    android:layout_height="180dp"
                    android:layout_marginStart="20dp"
                    android:layout_marginEnd="20dp"
                    android:background="@drawable/okvir"
                    android:orientation="vertical"
                    android:weightSum="1"
                    tools:layout_editor_absoluteX="240dp"
                    tools:layout_editor_absoluteY="305dp">

                    <TextView
                        android:id="@+id/player4_title"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:elegantTextHeight="true"
                        android:fontFamily="@font/bangers"
                        android:gravity="center"
                        android:text="PLAYER 4"
                        android:textAlignment="center"
                        android:textColor="#ffffff"
                        android:textSize="24sp" />

                    <LinearLayout
                        android:id="@+id/player4_2"
                        android:layout_width="144dp"
                        android:layout_height="103dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:orientation="horizontal">

                        <ImageView
                            android:id="@+id/player4_card1"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="7dp"
                            android:layout_marginEnd="7dp"
                            android:layout_weight="1"
                            android:src="@drawable/backside" />

                        <ImageView
                            android:id="@+id/player4_card2"
                            android:layout_width="0dp"
                            android:layout_height="wrap_content"
                            android:layout_marginStart="7dp"
                            android:layout_marginEnd="7dp"
                            android:layout_weight="1"
                            android:src="@drawable/backside" />
                    </LinearLayout>

                    <LinearLayout
                        android:id="@+id/linear4_stats"
                        android:layout_width="match_parent"
                        android:layout_height="match_parent"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:layout_marginBottom="5dp"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/win_stats4"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="WIN\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />

                        <TextView
                            android:id="@+id/draw_stats4"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="TIE\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />

                        <TextView
                            android:id="@+id/lose_stats4"
                            android:layout_width="0dp"
                            android:layout_height="match_parent"
                            android:layout_weight="1"
                            android:gravity="center"
                            android:text="LOSE\n00,00%"
                            android:textColor="#FFFFFF"
                            android:textSize="10sp" />
                    </LinearLayout>

                </LinearLayout>

            </LinearLayout>

            <!--
        Kraj vanjskog sloja!
        -->
        </LinearLayout>

    </ScrollView>

</androidx.constraintlayout.widget.ConstraintLayout>

A: Try to use a NestedScrollView instead of the ScrollView ...that usually this is only required for CoordinatorLayout, but it eventually may also be the case within a ConstraintLayout.


text:
Q: Saving a notebook as a $\LaTeX$ file, with syntax highlighting preserved How can I save a notebook as a $\LaTeX$ file, while preserving the syntax highlighting (such as input/output boxes)?

A: Personally I'm always disappointed by the quality of the conversion done when one simply saves a notebook as a TeX file--it never looks like what I want or expected. But perhaps this isn't too surprising, as the two file types are very different, and therefore many choices need to be made about the conversion.
I think a good general approach for solving questions of this kind is to write some Mathematica code to perform the conversion for you. Code in one notebook can open and read the contents of another notebook, manipulate it as you require, and spit it out as $\LaTeX$ file.
Here is some code I've written for my own purposes. It doesn't directly solve your problem but illustrates the general principle. First, let's open the notebook we want to convert "input.nb".
nb = NotebookOpen[ToFileName[NotebookDirectory[], "input.nb"], Visible -> True];

And  prepare the grounds for writing the TeX file.
Check[DeleteFile[FileNameJoin[{NotebookDirectory[], "output.tex"}]], Null];
s = OpenWrite[FileNameJoin[{NotebookDirectory[], "output.tex"}]];

Now for my application, I was not very interested in the input cells. I wanted to extract the Title, the Section and Subsection headings, any Text cells, and the Output cells.
The output cells are likely to need the most processing, so I defined the following function to deal with them. If the cell contains a graphics object, it exports it as a PDF (with some silly name generated using the Hash function) and prepares a string to put into the TeX file to include the pdf graphics in the final document. Otherwise it assumes it is an equation, and applies TeXForm to it.
 OutputCell[cell_] :=
  If[! FreeQ[cell, GraphicsBox],
   Export[IntegerString[Hash[cell], 36, 5] <> ".pdf", cell];
   "\\begin{figure}[!ht]\n\\begin{center}\n\\includegraphics{" <>
    IntegerString[Hash[cell], 36, 5] <> ".pdf" <>
    "}\n\\end{center}\n\\end{figure}\n",
   "\\begin{equation}\n" <> ToString@TeXForm@DisplayForm@cell <>
    "\\end{equation}\n"];

Now we are ready to actually iterate through the cells in the input notebook and write to the file stream we opened earlier. Here I specify my own, very short, preamble for the TeX file and I apply some rules to the contents of Text cells to replace curly quotes that for some reason don't appear properly in the TeX.
If you wanted to use this to process Input cells also, you'd simply add a case to the Switch statement and to the CellStyle option of Cells.
WriteString[s,
  "\\documentclass[10pt]{article}  \n\\usepackage{fullpage} \n\
\\usepackage{graphicx} \n\\usepackage{amsmath} \n\
\\usepackage{amssymb} \n\\begin{document}\n",
  Sequence @@ Riffle[Switch[#[[2]],
       "Text",
       StringReplace[#[[1]], {"\[CloseCurlyDoubleQuote]" -> "\"",
          "\[OpenCurlyDoubleQuote]" -> "\"",
          "\[CloseCurlyQuote]" -> "'", "\[OpenCurlyQuote]" -> "'"}] <>
         "\n",
       "Title", "\\title{" <> #[[1]] <> "}\n\\maketitle",
       "Section", "\\section{" <> #[[1]] <> "}\n",
       "Subsection", "\\subsection{" <> #[[1]] <> "}\n",
       "LaTeX", #[[1]] <> "\n",
       "Output", OutputCell[#]] & /@ (NotebookRead /@
       Cells[nb,
        CellStyle -> {"Title", "Section", "Subsection", "Text",
          "LaTeX", "Output"}]), "\n"], "\n\\end{document}"];

Close[s];

At the end we close the file stream. You'll notice a reference to a cell style "LaTeX", this is simply a style I've got in one of my custom stylesheets, the intention being to allow me to write $\LaTeX$ code in a notebook and just have it included in the TeX file verbatim.
This code reduces your problem to implementing the syntax highlighter in Mathematica, or finding a $\LaTeX$ package to do it for you (which you'd then need to mention in the preamble). But it also makes possible far more general manipulations that, I imagine, could be fairly useful.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Simplification with exponents I'm currently revising an exam about channel coding in telecommunications and we have a question where we need to isolate a variable $u$ in terms of another variable $q$. Currently, I am stuck with a rather difficult expression to simplify or at least I can't see what the trick is (if there is one). Here is the said expression:
$$log_2\big(q^q(1-q)^{1-q}\big) = log_2\bigg((\frac{qu}{1-qu})^q\bigg)$$
Being perfectly honest, I know that the $log_2$ simplifies on each side but having $u$ in both the numerator and denominator of the fraction which has an overall exponent, I'm quite out of my comfort zone mathematically.
Thanks in advance!

A: Since we have on both sides the base $2$ we get
$$q^q(1-q)^{1-q}=\left(\frac {qu}{1-qu}\right)^q$$ Let's say $$A=q^q(1-q)^{1-q}$$ then $$a^{1/q}=\frac{qu}{1-qu}$$ so $$A^{1/q}-qA^{1/q}=qu$$ and $$A^{1/q}-quA^{1/q}=qu$$ so $$A^{1/q}=u(q+qA^{1/q})$$ and we obtain
$$u=\frac{A^{1/q}}{q+qA^{1/q}}$$


text:
Q: Как вставить у себя на сайте боковую закладку под названием , к примеру, "Online-консультант"? Если кто-то из мастеров владеет таким HTML-кодом или знает Интернет-ресурс, где можно
сгенерировать код такой закладки, поделитесь, пожалуйста.
A: Я для сайта использовал решение mibew. Очень удобно и быстро. Весьма рекомендую.


text:
Q: KeyguardManager Memory Leak I'm using this code to DismissKeyguard after activity finished LeakCanary displays below message. how to prevent these leak.
keyguardManager = (KeyguardManager) getSystemService(Activity.KEYGUARD_SERVICE);

if(Build.VERSION.SDK_INT >= 27) {

    setShowWhenLocked(true);
    setTurnScreenOn(true);

    if (keyguardManager != null) {
        keyguardManager.requestDismissKeyguard(this, null);
    }
}

LeakCanary showing
GC Root: Global variable in native code
    │
    ├─ android.app.KeyguardManager$1 instance
    │    Leaking: UNKNOWN
    │    Anonymous subclass of com.android.internal.policy.IKeyguardDismissCallback$Stub
    │    ↓ KeyguardManager$1.val$activity
    │                        ~~~~~~~~~~~~
    ╰→ com.example.myapplication.MainActivity instance
         Leaking: YES (ObjectWatcher was watching this because com.example.myapplication.MainActivity received Activity#onDestroy() callback and Activity#mDestroyed is true)

A: The leaktrace indicates that there is a global variable in native code that keeps a reference to an instance of KeyguardManager$1 which implements com.android.internal.policy.IKeyguardDismissCallback$Stub, and KeyguardManager$1 itself holds a reference to the activity.
The sources for the implementation of KeyguardManager#requestDismissKeyguard can be found here: https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/KeyguardManager.java#574 :
ActivityTaskManager.getService().dismissKeyguard(
        activity.getActivityToken(), new IKeyguardDismissCallback.Stub() {
    @Override
    public void onDismissError() throws RemoteException {
        if (callback != null && !activity.isDestroyed()) {
            activity.mHandler.post(callback::onDismissError);
        }
    }
    @Override
    public void onDismissSucceeded() throws RemoteException {
        if (callback != null && !activity.isDestroyed()) {
            activity.mHandler.post(callback::onDismissSucceeded);
        }
    }
    @Override
    public void onDismissCancelled() throws RemoteException {
        if (callback != null && !activity.isDestroyed()) {
            activity.mHandler.post(callback::onDismissCancelled);
        }
    }
}, message);

That's an Inter Process Call to the ActivityTaskManager service process. The stubs that is set to receive a result when the ActivityTaskManager service process calls back holds the reference to the activity. Unfortunately, native stubs tend to be held in memory longer than expected because they're dependent on the GC running in the other process.
This is clearly a bug in the Android framework. You should file a bug to the Android framework and provide a sample app that reproduces it.

A: To minimize the leak, you can check isKeyguardLocked() before perform requestDismissKeyguard(), unlock only if really need to:
if ( (keyguardManager != null) && keyguardManager.isKeyguardLocked()) {
    keyguardManager.requestDismissKeyguard(this, null);
}


text:
Q: how to use annotation to validate LocalDateTime in spring boot I'm using the @Valid to validate the RequestBod data, see bellow:
Controller MemberController.java
public R<String> addMember(@Valid @RequestBody AddMemberVO memberVO) {
    ...
}

Model AddMemberVO.java
public class AddMemberVO{
    //Member card start time
    private LocateDateTime startTime;

    //Member card end time
    private LocateDateTime endTime;

    ...
}

For this api, i want to validate the startTime and endTime using annotation.
all date use the same pattern yyyy-MM-dd HH:mm:ss
if input:
{
"startTime":"2021-10-01 94:00:00",
"EndTime":"2021-10-01 14:00:00"
}
except result: startTime format is invalid.
if input:
{
"startTime":"2021-19-01 00:00:00",
"EndTime":"2021-10-01 14:00:00"
}
except result: startTime format is invalid.
i found a way - change the startTime and endTime from LocalDateTime to String, but i don't think this is a good idea. because if changed, I should do a lot of things about convert String to LocalDateTime.
is there any other ways to validate this scene(use LocalDateTime) for my code?


text:
Q: Get value of multiple checkbox in angular primeng
*

*Want to get the value from multiple checkbox.

*Each row consist of user name and permission given to user ie read, write.

*In the following following code I am trying to give the permission to user ie read, write.

*for UI am using primeng checkbox.

*on check the value read need to be added to user array.

app.component.ts
import { Component, OnInit } from '@angular/core';
import { supportsWebAnimations } from '@angular/animations/browser/src/render/web_animations/web_animations_driver';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {

  users: Array<any>;
  permissions: Array<any> = [];

  ngOnInit(){

    this.users = [
      {id: 1, name: 'Sam', permission: []},
      {id: 2, name: 'Adam', permission: []},
      {id: 3, name: 'Chris', permission: []}
    ]

  }
}

app.component.html

Permission

Name

Read

Write

{{user.name}}

A: Instead of maintaining a permission array you can maintain a permission object and bind it your checkboxes.
There will be no need to maintain an index in that case.
Your code will be like this:
import { Component, OnInit } from '@angular/core';
import { supportsWebAnimations } from '@angular/animations/browser/src/render/web_animations/web_animations_driver';

@Component({
  selector: 'my-app',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent implements OnInit {

  users: Array<any>;
  permissions: Array<any> = [];

  ngOnInit(){

    this.users = [
      {id: 1, name: 'Sam', permission: { read: true, write: true}},
      {id: 2, name: 'Adam', permission: { read: false, write: true}},
      {id: 3, name: 'Chris', permission: { write: true, read: false}}
    ]
  }

}

And your HTML:

Permission

Name

Read

Write

{{user.name}}

And with PrimeNG
You need to add

binary="true"

attribute to your checkbox
You can see the demo here

A: You have to have those read/write flags in your model and connect those to proper checkboxes. eg
this.users = [
  {id: 1, name: 'Sam', permission: {read:false,write:false}},
  {id: 2, name: 'Adam', permission: {read:false,write:false}},
  {id: 3, name: 'Chris', permission: {read:false,write:false}}
]

and

{{user.name}}

values in model will switch accordingly to true/false depending on checkbox state. That is at least how I would do it.


text:
Q: AWS API Gateway Timeout after ~30 seconds AWS API Gateway timeout after around 30 seconds. I connected the API gateway to a lambda function that runs far longer than 30 seconds.
So the API response times out after around ~30 seconds and give back something like a timeout response.
How do I solve this problem and get my response back from Lambda?
Thank you.

A: The API Gateway has a maximum integration timeout of 30 seconds (API Gateway Limits), so there is nothing you can do to increase it.
What you could do is accept the request, create and ID and put it in a queue.
Then you send an HTTP 202 Message with the request id back to the client.
Now a Lambda function can be triggered from the Queue asynchronously that performs the work.
It later persists the results of the query somewhere under the request id (maybe only for a period of time).
The client can then use the request ID and poll a second API gateway for the status, which is able to return the response once it's present.

A: You cannot do anything about api Gateway timeout, it is having hard limit of 30 seconds.
A Solution for this is to use alb with aws
lambda, alb is not having any timeout limit.
Another option is polling based as suggested in previous answer by @Maurice.


text:
Q: Why won't my app render when state changes? I'm building an application that allows for posting community concerns with the ability to upvote those concerns using React, and right now, I am working on the upvote functionality.  One way I'm trying to limit the currently logged in user to a single vote is to disable the button once an upvote has been successfully registered for any given post.
To do this, I created a function that checks if the logged in user's ID matches the ID of the upvote for each post.  If no match is found, this means the user hasn't voted for already and can register the new upvote.  Once this is complete, the button is disabled.  I created state for this and is set to false upon the initial render (not sure if this is what I should be doing).  I also created state for the all of the votes that have been successfully registered.  Both are included below.
const [alreadyVoted, setAlreadyVoted] = useState(false);
const [userVotes, setUserVotes] = useState(upvotes) // upvotes is being passed via props

I'm using the useEffect hook (again, not sure if this is the best way) to check if each button should be enabled or disabled like so:
useEffect(() => {
  hasVoted()
}, [userVotes])

Finally, my hasVoted function checks to see if the user has already voted for the issue before and determines the state.  It looks like:
function hasVoted() {
  userVotes.forEach(vote => {
    if (vote.issue_id === issue.id) {  // issue here is from props
      setAlreadyVoted(true) // I want this to then disable my button
    }
  })
}

Right now, when I click the button to register the upvote, the page doesn't rerender upon clicking.  However, if I refresh the page, the button is successfully disabled as it should be.  It probably goes without saying, I'm still getting the hang of React, but any and all help is appreciated.

A: This code is meaningless at first place
userVotes.forEach(vote => {
    if (vote.issue_id === issue.id) {  // issue here is from props
      setAlreadyVoted(true) // I want this to then disable my button
    }
  })

, it can be transformed into
if (userVotes.some(vote => vote.issue_id === issue.id)) setAlreadyVoted(true)

but still the logic of it is not clear

A: I think hasVoted function should be in the useEffect scope. If it's outside, it might introduce bugs, as documented here: https://reactjs.org/docs/hooks-faq.html#is-it-safe-to-omit-functions-from-the-list-of-dependencies
You could try if this helps to resolve your problem

A: you seem to be somewhat on the right track here but your problem  may lay elsewhere,provided the props are passed correctly,because the application does re-render when the state changes. if you want to just disable button you can just use simple html attribute to do that
    {alreadyVoted ? (
        <button class="btn btn-success" disabled="disabled">
          Upvote
        </button>
      ) : (
        <button
          class="btn btn-success"
          onClick={() =>
        // Add the id to the setUserVotes here
       setAlreadyVoted(true)}
        >
          Upvote
        </button>
      )}

Take a look at this codesandbox that i just created and get back to me if you have any issues still


text:
Q: Passing more than two arguments in reduce function I am aware that Python reduce only accepts a function with two arguments. However, is there a way to make more than two arguments available to the function? I don't want to make it a global variable because that would be visible for all other imports. The following snippet might help describing the problem (Please read the comments in the snippets):
# The reduce function
def apply_something(something, config):
    # Consrtuct a class object based on the truth value of some other variable.
    # some_var can be changed and is being accessed in different threads so its
    # not safe to make it global. The reduce function is being called from
    # inside some other function so It would be better to make
    # some_var only accessible in the function context.

    if some_var:
        obj = Klass(some_var)
    else:
        obj = Klass()

def callee():
    # This is how I apply the reduce operation.
    reduce(apply_something, [1, 2, 3], something_initializer)

    # I want something like this:
    some_var = True  # So this can be accessed in apply_something

Please provide some insight into this kind of problem.

A: Strictly speaking, the function passed to reduce will always be called with two arguments. However, these types of functions will often access variables in an outer scope. Since I'm unclear on your exact problem, let's implement join in terms of reduce:
def join(joining_string, strings_to_join):
    # i.e., join('-', ['a', 'b', 'c']) -> 'a-b-c'
    # Here, we need an extra piece of data in our reduce function:
    #   joining_string.

    def do_reduce(a, b):
        # Joining string comes from the outer scope:
        return a + joining_string + b

    return reduce(do_reduce, strings_to_join)

Also, Chris Martin's solution involving partial is perfectly correct as well. Applying it to the above would look like this:
# This didn't *need* to move out of join, but it can. Before, it needed
# to be in join to be able to "capture" the local variable joining_string.
def do_reduce(a, b, joiner):
    # Joining string comes from the outer scope:
    return a + joiner + b

def join(joining_string, strings_to_join):
    # i.e., join('-', ['a', 'b', 'c']) -> 'a-b-c'
    # Here, we need an extra piece of data in our reduce function:
    #   joining_string.

    return reduce(
        functools.partial(do_reduce, joiner=joining_string),
        strings_to_join)

A: I think what you're looking for is partial function application, which you can do using functools.
def apply_something(something, config, some_var):
    pass  # ...

import functools

functools.reduce(functools.partial(apply_something, some_var=True),
       [1, 2, 3], something_initializer)

Example:
>>> def foo(a, b, c):
...     return a + b if c else a * b

>>> functools.reduce(functools.partial(foo, c=True), [1,2,3,4,5], 0)
15

>>> functools.reduce(functools.partial(foo, c=False), [1,2,3,4,5], 1)
120

A: You could as well just use a lambda:
def foo(total, cur, some_var=False):
    pass  # ...

reduce(lambda total, cur: foo(total, cur, some_var=True), [1, 2, 3], init)


text:
Q: How do I access the app_data in actix_web's Guard::check() function? I am trying to implement a custom guard that checks if the authorization token is valid:
impl Guard for AuthGuard {
    fn check(&self, ctx: &GuardContext<'_>) -> bool {
        // check header value here
        // and retrieve connection pool from app_data
    }
}

A: Taking a look at GuardContext, you can see that there is req_data and head. And hence one can do.
impl Guard for AuthGuard {
    fn check(&self, ctx: &GuardContext<'_>) -> bool {
        let jwt = ctx.req_data::<Jwt>().unwrap();
        let token = ctx.head().headers().get(header::AUTHORIZATION).unwrap();
        jwt.is_valid(token)
    }
}

The things you are asking for are there but remember that Checks are blocking.

*

*Checks can be good to check whether a token exists and its valid.

*Checks are not suitable in a scenario where you need to check if a token exists in Redis or sqlx pool.

If you need to do async stuff you might need to think of FromRequest or middleware. See this question.


text:
Q: OSGI startup is very slow I'm trying to figure out why the OSGI startup process of our RCP application is so slow and were the time is lost.
I have enabled osgi.debug with the following options:

org.eclipse.osgi/profile/startup = true
  org.eclipse.osgi/profile/benchmark = true
  org.eclipse.osgi/profile/debug = true

Below is a snippet from the profiling output

*

*9754 :     0       >> BundleContextImpl.startActivator() > enter

*9754 :     0       -- BundleContextImpl.startActivator() > calling initial@reference:file:plugins/com.razorcat.ite.ui.views_1.0.0 .jar/
  bundle activator

*9754 :     0       -- BundleContextImpl.startActivator() > returned from initial@reference:file:plugins/com.razorcat.ite.ui.views
  _1.0.0.jar/ bundle activator

*9754 :     0       << BundleContextImpl.startActivator() > exit

*38896 : 29142       >> BundleContextImpl.startActivator() > enter

*38896 :     0       -- BundleContextImpl.startActivator() > calling initial@reference:file:plugins/com.razorcat.tessy.remoting.web
  app_1.0.1.jar/ bundle activator

*38896 :     0       -- BundleContextImpl.startActivator() > returned from initial@reference:file:plugins/com.razorcat.tessy.remoti
  ng.webapp_1.0.1.jar/ bundle activator

*38896 :     0       << BundleContextImpl.startActivator() > exit

I wonder if there is a way to find were the time (ca. 30 secs) is lost between the exit and enter entry. Is there any option to more fine tune the profiling output?


text:
Q: PHP regular expression to extract TwitPic link/code if present I would like to be able to check a string of text and extract a TwitPic URL if it is present in the string, ultimately I would like just the code portion, but either will do.
Example:
"blah blah blah http://twitpic.com/1aso4q blah blah"

Desired result:
http://twitpic.com/1aso4q

or
1aso4q

How can I do it?

A: preg_match_all('#http://twitpic.com/(\w+)#', $content, $matches);

You will then have all the codes in $matches[1].

A: Try following regex
'/http:\/\/twitpic\.com\/\S+/i'

A: $str = "blah blah blah http://twitpic.com/1aso4q blah blah";
$s = explode(" ",$str);
print_r( preg_grep('/http:\/\/twitpic.com/',$s) );


text:
Q: How to change the color of a dynamically created element? I have this dynamically created classroom which has 3 buttons on the side.
 for classroom in classrooms
   if classroom.author.id == user.id
      tr#bothcells
        td#classroomcell= classroom.classroomname
        td#buttonscell
           button.renameclassroom(data-toggle="tooltip", data-placement="top" ,title="Rename this classroom" type='button' style='font-size:15px', onclick='renameclassroom($(this))' value=classroom.id)
              i.fas.fa-pencil-alt
           button.showstudents(data-toggle="tooltip", data-placement="top" ,title="Show all students belonging to this classroom" style='font-size:15px' type='button',  onclick='get($(this))', value=classroom.id )
              i.fas.fa-user-graduate
           a.deleteclassroom(data-toggle="tooltip", data-placement="top" ,title="Delete this classroom" style='font-size:15px',href="/classroom/delete/" + classroom._id)
              i.fas.fa-times

..and this jQuery AJAX for getting the name of the students belonging to that classroom.
function get(a){
  var classroomvalue = a.val();
  $.ajax({
    type: 'GET',
    url: 'http://localhost:8080/classroom/' + classroomvalue,
  })

  .done(function(data) {
    console.log('Get response:', JSON.stringify(data,  "", 2));
    $("#getResponse").html($(data).find('#students').html());
  })
  .fail(function(jqXHR, textStatus, err) {
    console.log('Ajax error response:', textStatus);
  });
};

Where do I struggle and what it's my question?
I need to change the button icon color when pressed since the classroom and the buttons are created dynamically, I know I can't use the Id but the value. I have a really hard time finding a solution, and I couldn't come up with anything.
UPDATED HTML GENERATED

A: First of all, having multiple elements share the same id is wrong, because the id attribute is meant to uniquely identify an element. That aside, you can get away with it in this case with the following code. You'd better use classes, however.
Code:
function get (a) {
  var classroomvalue = a.val();

  $.ajax({
    type: 'GET',
    url: 'http://localhost:8080/classroom/' + classroomvalue,
  })
  .done(function (data) {
    console.log('Get response:', JSON.stringify(data, "", 2));
    $("#getResponse").html($(data).find('#students').html());

    /* Reset the colour of all buttons' icons. */
    a.closest("tbody").find("tr button > i").css("color", "");

    /* Make the current button's icon's colour red. */
    a.children("i").css("color", "red");
  });
};


text:
Q: Eclipse (CDT): include a subdirectory, exclude it from any build What is the proper way to include a newly created subdirectory into the project, but exclude its content from building?

A: If folder you created is inside your project tree than, click on your project in ProjectExplorer view and than simple F5 will refresh yor project content.
If folder you created is outside your project tree, than right-click on your project in ProjectExplorer view and than New→Folder→Advanced→Link to Alternate Location→ browse for your folder.
To exclude folder from build right-click on your new folder in ProjectExplorer view and than you can find the option under Recource Configuration→Exclude from Build....
Folder should go gray after excluding.


text:
Q: stringdist_join not merging data I have three data frames that need to be merged. There are a few small differences between the competitor names in each data frame. For instance, one name might not have a space between their middle and last name, while the other data frame correctly displays the persons name (Example: Sarah JaneDoe vs. Sarah Jane Doe). So, I used the fuzzy join package. When I run the below code, it just keeps running. I can't figure out how to fix this.
Can you identify where I went wrong?
library(fuzzyjoin)
library(tidyverse)

temp1 = read.csv('https://raw.githubusercontent.com/bandcar/bjj/main/temp1.csv')

stats=read.csv('https://raw.githubusercontent.com/bandcar/bjj/main/stats.csv')

winners = read.csv('https://raw.githubusercontent.com/bandcar/bjj/main/winners.csv')

#perform fuzzy matching full join
star = stringdist_join(temp1, stats,
                by='Name', #match based on Name
                mode='full', #use full join
                method = "jw", #use jw distance metric
                max_dist=99,
                distance_col='dist') %>%
  group_by(Name.x)


text:
Q: Android Toolbar back button not being recognised I am working on an the settings screens for an android appliation.
The settings screen contains 2 'sub screens' both have a toolbar and a have a back button.
The back button on screen 1 does nothing
The back button on screen 1 works perfectly and returns me to the main settings screen (the 'hard' back button works for both screens)
Screen 1 (Preferences Screen):

Screen 1 xml:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_preferences"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.clear.pocketcross.Preferences">

    <Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?android:attr/colorPrimary"
        android:popupTheme="@android:style/ThemeOverlay.Material.Light"
        android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/toolbar"
        android:orientation="vertical"
        android:paddingBottom="@dimen/activity_vertical_margin"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"
        android:paddingTop="@dimen/activity_vertical_margin">

        <Switch
            android:id="@+id/counterscroll"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:defaultValue="true"
            android:key="counter_scroll"
            android:shadowColor="@color/gradient_mid"
            android:shadowDx="5"
            android:shadowDy="5"
            android:text="@string/scrollCounters"
            android:thumb="@drawable/pocketcross_btn_radio_on_holo_light" />

        <Switch
            android:id="@+id/navswipe"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:defaultValue="true"
            android:key="nav_swipe"
            android:shadowColor="@color/gradient_mid"
            android:shadowDx="5"
            android:shadowDy="5"
            android:text="@string/swipeTitle"
            android:thumb="@drawable/pocketcross_btn_radio_on_holo_light" />
    </LinearLayout>

</RelativeLayout>

Java for Screen 1:
Switch nav;
Switch scroll;
SharedPreferences shared;
public static final String MyPREFERENCES = "PocketCross";

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_preferences);
    Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
    //Toolbar will now take on default Action Bar characteristics
    setActionBar(toolbar);
    getActionBar().setDisplayHomeAsUpEnabled(true);

    this.setTitle("Preferences");

    nav = (Switch) findViewById(R.id.navswipe);
    scroll = (Switch) findViewById(R.id.counterscroll);

    if (shared == null) {
        shared = this.getSharedPreferences(MyPREFERENCES, Context.MODE_PRIVATE);
    }
    nav.setChecked(shared.getBoolean("nav_swipe", true));
    scroll.setChecked(shared.getBoolean("counter_scroll", true));

    nav.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            SharedPreferences.Editor spEdit = shared.edit();
            spEdit.putBoolean("nav_swipe", isChecked);
            spEdit.apply();
        }
    });

    scroll.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() {
        @Override
        public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
            SharedPreferences.Editor spEdit = shared.edit();
            spEdit.putBoolean("counter_scroll", isChecked);
            spEdit.apply();
        }
    });
}

Screen 2 (Pocket Cross Parameters Screen):

XML for Screen 2:
    <?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/parametersTable"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:shrinkColumns="*"
    android:stretchColumns="*"
    android:background="@color/background"
    android:clickable="false">

    <Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="?android:attr/colorPrimary"
        android:theme="@android:style/ThemeOverlay.Material.Dark.ActionBar"
        android:popupTheme="@android:style/ThemeOverlay.Material.Light" />

    <ListView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:id="@+id/parametersList"
        android:layout_centerVertical="true"
        android:layout_centerHorizontal="true"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:layout_marginBottom="@dimen/activity_vertical_margin"
        android:layout_marginLeft="@dimen/activity_horizontal_margin"
        android:layout_marginRight="@dimen/activity_horizontal_margin"
        android:layout_below="@+id/toolbar" />

</RelativeLayout>

Java for Screen 2: -
        @Override
        protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_paramaters);
        setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

        Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
        //Toolbar will now take on default Action Bar characteristics
        setActionBar(toolbar);
        getActionBar().setDisplayHomeAsUpEnabled(true);

        this.setTitle(R.string.parametersTitle);

        mntFile = MainMenu.mntFile;

        fileData = xmlTools.getXmlFile(mntFile);
        tags = fileData.xmlTags;
        for (int i = 0; i < tags.size(); i++) {
            tag = tags.get(i);
            if (tag.nodeTag.equalsIgnoreCase("PocketCrossSysParam")) {
                nodes = tag.nodeData;
                paramSetting = xmlTools.getNodeFromList(nodes, "ParamName");
                paramValue = xmlTools.getNodeFromList(nodes, "ParamValue");
                parameter = new PocketCrossParameter(paramSetting,paramValue);
                parameters.add(parameter);
            }
        }
        loadParams();
    }

(loadParams is a function to get the various parameters from an xml file)
I have tried adding the following to my code but still the back button does nothing: -
@Override
public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case android.R.id.home:
            onBackPressed();
            return true;
        }

    return super.onOptionsItemSelected(item);
}

What I am struggling to understand is why the back button on every single screen in my app works perfectly except this one.
I'm guessing it will be something obvious but I have no idea what.

A: In your manifest.xml add this line, android:parentActivityName=".(Name of the activity you want to return)"
Just like this
<activity
            android:name=".(CurrentActivity)"
            android:parentActivityName=".(Activity to be returned)"/>

A: You can check the following
1) Your activity extend AppCompatActivity
2)
Toolbar mToolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(mToolbar);
getSupportActionBar().setTitle("Title");
getSupportActionBar().setDisplayHomeAsUpEnabled(true);

3) override the following method
    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        if (item.getItemId()== android.R.id.home) {
            finish();
            return true;
        }
        return super.onOptionsItemSelected(item);
    }

A: The issue seems to be with your xml file. You have specified your parent layout as clickable false and hence not getting your click calls. Try removing it.


text:
Q: Video transparency with A-Frame and Three.js I'm forwarding this open issue from A-Frame Github page hoping that some people may know what's going on with this issue. It's still not working with A-Frame 1.0.3 and I don't really know where to search. There are two examples on the Github issue, one working with A-Frame 0.8.0 and the other one with A-Frame 0.9.0. There are absolutely no warnings or information in the javascript console so it's kinda hard to find where the issue can be.
On version 0.8.0 it used Three v90 and on 0.9.0 it used v101. So maybe something was made between these two versions on Three but I don't understand what.
Did anybody find a way to use videos with transparency on recent versions of A-Frame and/or Three.js ?
Thanks for your help :)

A: It seems that the assigned texture format doesn't have the alpha channel (THREE.RGBFormat, you can log and check the values here).
You can resolve the issue by changing the format of the video texture to THREE.RGBAFormat:
videoTexture.format = THREE.RGBAFormat

within a custom component containing a fix like this:
// wait until the material is ready
this.el.addEventListener('materialtextureloaded', e => {
   // grab the material
   let material = this.el.getObject3D("mesh").material;
   // swap the format
   material.map.format = THREE.RGBAFormat;
   material.map.needsUpdate = true;
})

working glitch here.


text:
Q: Disabling CSS rules Is there any way to disable a CSS rule?
I ask because I am using Kendo UI, and their rules are very all-encompassing, eg:
.k-grid td
{
   // styles
}

However if I put my table inside their table it will be styled up similarly, so its affecting far too much and needs to be removed/replaced. I don't want to have to manually overwrite the rules and keep up to date with any of kendo's changes. I don't want to have to manually delete it every time I update kendo files either.
Any chance of an easy fix? Thanks

A: Unfortunately there is no better way to disable a CSS rule for an element that is matched by that rule except by overwriting everything the rule defines.

A: You will have to override those style attributes in a separate css with !important
.k-grid td
{
   // UI styles
   color:#000;
}

/* your style */
.k-grid td
{
   // styles
   color:#fff !important;
}


text:
Q: Restoring the database dump of an older version of mongo to a new version of mongo Currently, I have an older version of mongo, i.e 2.6 running on my system. I already have my site in production and have a lot of client data. I am planning an upgrade to mongo 3.2.
So, my question is whether mongorestore of mongo v3.2 work with data dump of v2.6? Or, is it known to create problems?
Any answers will be invaluable! Thanks

A: As you have data from mongo 2.6, index field limitation is already fulfilled.
Mongo 3.2 will restore this backup without any issue.
The other way you can upgrade your db (if you have replica set) is to replace one 2.6 member with 3.2 and wait for sync, then other one... This will give you business continuity :-)

A: I asked this same question on the official MongoDB mailing list. They said not to upgrade more than 1 major version at a time. (Major versions being: 2.2, 2.4, 2.6, 3.0, 3.2, 3.4)
I didn't want to follow the normal upgrade process of installing every version Just to launch mongod and then shut it down. That feels to me like it would leave cruft behind and I like to have my infrastructure building scripted and version controlled. So, I decided to launch new EC2 instances with the latest Ubuntu (since my Mongo v2.4 servers were also 2 LTS versions behind) and the latest MongoDB. I used docker images of intermediate versions of MongoDB to do the data upgrades.
https://gist.github.com/RichardBronosky/2d04c7c2e9a5bea67cd9760a35415a3f#file-uat_mongodb_upgrade_from_prod-sh
The bulk of the solution is this:

# mongo.conf is using the default dbPath: /var/lib/mongodb
# this path is for temporary use by the mongo docker container
mkdir -p /data/db/dump
# see: https://hub.docker.com/_/mongo/ (search for /data/db)
# see: https://github.com/docker-library/mongo/blob/30d09dbd6343d3cbd1bbea2d6afde49f5d9a9295/3.4/Dockerfile#L59
cd /data/db
mongodump -h prodmongo.int

# Get major versions from https://hub.docker.com/r/library/mongo/tags/
step=0
for major_version in 2.6.12 3.0.14 3.2.11 3.4.1; do
    sudo docker stop some-mongo || true
    sudo docker rm   some-mongo || true
    sudo docker run --name some-mongo -v /data/db:/data/db -d mongo:$major_version
    false; while [[ $? > 0 ]]; do
        sleep 0.5
        sudo docker exec -it some-mongo mongo --eval 'printjson((new Mongo()).getDBNames())'
    done
    if (( $step == 0 )); then
        sudo docker exec -it some-mongo mongorestore /data/db/dump
    fi
    ((step += 1))
done

# Finish up with docker
sudo rm -rf /data/db/dump/*
sudo docker exec -it some-mongo bash -c 'cd /data/db; mongodump'
sudo docker stop some-mongo
sudo docker rm   some-mongo

# Load upgraded data into latest version of MongoDB (WiredTiger storage engine will be used)
mongorestore /data/db/dump
sudo rm -rf /data

A: Bruno's answer worked for me up to version 3.4, but then there was a problem each update required setting a feature compatibility version, then at 4.2 you can't start mongo if you're still using MMAPv1, you need to switch to WiredTiger.
So, thank you very much Bruno, you got me most of the way there.
Below is my updated script, hope it helps someone out!
#!/bin/bash

# Log commands to stdout
set -o xtrace
# Exit on error
set -o errexit
# Exit on use of unset variables
set -o nounset
# Exit and report on pipe failure
set -o pipefail

# mongo.conf is using the default dbPath: /var/lib/mongodb
# this path is for temporary use by the mongo docker container
mkdir -p /data/db/dump
# see: https://hub.docker.com/_/mongo/ (search for /data/db)
# see: https://github.com/docker-library/mongo/blob/30d09dbd6343d3cbd1bbea2d6afde49f5d9a9295/3.4/Dockerfile#L59
cd /data/db
# our docker host holding the database
mongodump -h $PROD_MONGO_IP

# Get major versions from https://hub.docker.com/r/library/mongo/tags/
step=0
prev_real_major=""
for major_version in 2.6.12 3.0.15 3.2.21 3.4.24 3.6.23 4.0.27 4.2.17 4.4.10 5.0.3; do
    real_major=`echo $major_version | cut -f1,2 -d "."`
    sudo docker stop some-mongo || true
    sudo docker rm some-mongo || true
    docker run --rm -d --name some-mongo -v /data/db:/data/db mongo:$major_version
    set +o errexit
    false; while [[ $? > 0 ]]; do
        sleep 0.5
        docker exec -it some-mongo mongo --eval 'printjson((new Mongo()).getDBNames())'
        if [[ $real_major > 3.3 ]]; then
            docker exec -it some-mongo mongo --eval "db.adminCommand( { setFeatureCompatibilityVersion: \"$real_major\" } )"
        fi
    done
    set -o errexit
    if (( $step == 0 )); then
        docker exec -it some-mongo mongorestore /data/db/dump
    fi
    # upgrade to WiredTiger
    if [[ $real_major == 4.0 ]]; then
        # delete the database dump from earlier
        rm -rf /data/db/dump/
        # dump the database again
        docker exec -w /data/db -it some-mongo mongodump
        # stop the existing mongo container
        docker stop some-mongo
        # delete everything in /data/db except /data/db/dump
        find /data/db -mindepth 1 ! -regex '^/data/db/dump\(/.*\)?' -delete
        # run the 4.0 mongo container again
        docker run --rm -d --name some-mongo -v /data/db:/data/db mongo:$major_version
        # restore the database, which automatically makes it wiretiger.
        docker exec -it some-mongo mongorestore /data/db/dump
    fi
    ((step += 1))
done

# Finish up with docker
sudo rm -rf /data/db/dump/*
docker exec -it some-mongo bash -c 'cd /data/db; mongodump'
docker stop some-mongo

# Commented these out because I did them manually, you decide what you want to do here
# Load upgraded data into latest version of MongoDB (WiredTiger storage engine will be used)
# mongorestore /data/db/dump
# sudo rm -rf /data


text:
Q: How could a non-convex volume joining the outer points of a 3D anatomical model be created? I am trying to visualise segmented anatomical models in 3D. Currently, my attemps are very basic, like the following code. What other ways could you come up with? ListSurfacePlot3D doesn't work that well. The files contain lines with the coordinates of each voxel (x,y,z).
ClearAll["Global`*"];

prop = Import[#, "Table"] & /@ {"http://leaf.dragonflybsd.org/~beket/skull.txt",
"http://leaf.dragonflybsd.org/~beket/brainwhite.txt"};

genPoint[{x_, y_, z_}] :=
 Graphics3D[{FaceForm[Red], EdgeForm[], Lighting -> "Neutral",
   Sphere[{x, y, z}, 1/5]}]

ParallelTable[
 Show[genPoint /@ prop[[k]], ViewPoint -> {1.3, 2.4, 2.}, ImageSize -> 300],
    {k, 1, Length@prop}]

A: Why not use Mathematica's curated data instead?
Entity["AnatomicalStructure","Skull"]["Graphics3D"]


text:
Q: for loop return wrong username from firebase database but correct coordinate I using the list view to display the tutor from tlocation node in database with the same subject as student selected. Now I got problem when retrieving the data, it gave me the 2 users coordinate of the same subject but display with the same name.
Here's my database structure

And here's my code
 scref = db.getReference("users");
 tref = db.getReference("tlocation");
 sref = db.getReference("slocation");

 ul.clear();

 scref.addValueEventListener(new ValueEventListener() {
 @Override
 public void onDataChange(DataSnapshot dataSnapshot) {

 ps = dataSnapshot.child(un).child("position").getValue().toString();

 if (ps.equalsIgnoreCase("student")){

 Query q = tref.orderByChild("subject").equalTo(ssubject);
 q.addValueEventListener(new ValueEventListener() {
           @Override
 public void onDataChange(DataSnapshot dataSnapshot) {
           for (DataSnapshot u: dataSnapshot.getChildren()) {
                 susername = u.getKey();

 tref.child(susername).addValueEventListener(new ValueEventListener() {
 @Override
 public void onDataChange(DataSnapshot dataSnapshot) {
        sula = dataSnapshot.child("latitude").getValue().toString();
        sulo = dataSnapshot.child("longitude").getValue().toString();

        Location cl1 = new Location("");
        lat1 =  Float.parseFloat(la);
        lon1 = Float.parseFloat(lo);
        cl1.setLatitude(lat1);
        cl1.setLongitude(lon1);

        Location cl2 = new Location("");
        lat2 =  Float.parseFloat(sula);
        lon2 = Float.parseFloat(sulo);
        cl2.setLatitude(lat2);
        cl2.setLongitude(lon2);

        float distance = cl1.distanceTo(cl2);
        int i = 0;
  ul.add(new UserLocationData(i++, susername, String.valueOf(distance)));

  sla = new searchList(getApplicationContext(), ul);
              searchlist.setAdapter(sla);

         }

                                        @Override
                                        public void onCancelled(DatabaseError databaseError) {

                                        }
                                    });
                                }

                            }

                            @Override
         public void onCancelled(DatabaseError databaseError) {

                            }
                        });

                    }else if (ps.equalsIgnoreCase("tutor")){

                    }

                }

                @Override
                public void onCancelled(DatabaseError databaseError) {

                }
            });// end of scref

Here's my result

So please advice me on this question. Thank you.

A: Sometimes it happens. addValueEventListener get call twice. if u don't want repeated value u can clear the ArrayList value inside the addValueEventListener method. so that u won't get repeated value. u can also set an if condition if u have multiple addValueEventListener for the same ArrayList.


text:
Q: What font awesome fa-icon-code css class should I use for forum link in sticky footer in website? For the link to Help section of the webpage, I am using  for icon in the sticky footer of the webpage.
What fa-class should i use for the link to Forum?

A: Usually we use these icons,

*

*commenting

*commenting-o

*comments

*comments-o
You can also build a custom icon by using set of icons available in the font-awesome icon set by stacking and aligning them accordingly.Stacked Icons
Here I designed something for you.You can use this as a forum icon.

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css" rel="stylesheet"/>


text:
Q: Android webview youtube iframe does not go fullscreen on share button click I cannot provide images of my app page due to company reasons.
This is the xml of a button and webview.
<Button
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_below="@+id/imageView2"
    android:layout_marginLeft="30dp"
    android:layout_alignParentLeft="true"
    android:id="@+id/stop"
    android:onClick="stop"
    android:text="Stop"/>

<WebView
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:id="@+id/webView"
    android:layout_below="@+id/stop"
    android:layout_centerHorizontal="true"
    android:layout_marginTop="10dp" />

And this is the java code
String ahtml = "<iframe class=\"col\" src=https://www.youtube.com/embed/"+videoArray[1]+" frameborder=\"0\" allowfullscreen></iframe>";
youtubeWebView = (WebView)findViewById(R.id.webView);
youtubeWebView.getSettings().setJavaScriptEnabled(true);
youtubeWebView.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
youtubeWebView.setWebViewClient(new WebViewClient(){
    @Override
    public boolean shouldOverrideUrlLoading(WebView view, WebResourceRequest request) {
        return false;
    }
});

This code is working fine.
Problem is that after clicking the share button,"in the youtube embed video",the height of the webview increases "downwards".
It does not go fullscreen as the button is not in the webview(which itself is not set to fill parent or full screen in the xml).
I want this button to hide and the webview to go fullscreen when the share button is clicked.
Thanks everyone for their time.


text:
Q: Firebase IOS Crash reporting not working - even when I force a crash I'm using Firebase Crash Reporting for IOS without cocoapods (manual install via SDK).
Crashes form my IOS app are not showing in the app dashboard, even when I force a crash. For example assert(false).
I'm using Firebase SDK https://dl.google.com/firebase/sdk/ios/3_2_1/Firebase.zip and this is what I've installed in my code
Analytics

*

*FirebaseAnalytics.framework

*FirebaseInstanceID.framework

*GoogleInterchangeUtilities.framework

*GoogleSymbolUtilities.framework

*GoogleUtilities.framework

Crash (~> Analytics)

*

*FirebaseCrash.framework

Can someone please confirm correct setup options, including settings in the GoogleService-Info.plist?


text:
Q: How can I make my slide content not to overlap with each other? This code basically shows hidden divs to slide up I just don't want them to overlap with each other whenever any of this button is clicked I want any div that is previously up to slide down. I would really appreciate it if you can also shorten my jquery code.

<title></title>

<input type="button" class="button1"></input>
<input type="button" class="button2"></input>
<input type="button" class="button3"></input>
<input type="button" class="button4"></input>

First div

second div

Third div

Fourth div

A: Hard to know exactly what you need here, but you could use the jQuery slideUp() and slideDown() callback function to tell you when the animation is complete:

$('#containerz').slideUp('slow', function() {
  $('#containers').slideDown('slow');
});

See example here. Hope it helps.
If you are looking for the animation to happen at the same time, you could try this:

$(".button1").click(function(event) {
  $('#containerz').slideUp('slow');
  $('#containers').slideDown('slow');
});

$(".button2").click(function(event) {
  $('#containers').slideUp('slow');
  $('#containerz').slideDown('slow');
});

See example here.
Extended answer:
Please see new demo here.
There was some duplicate code in your example so I have refactored it by splitting the duplicated code out into a seperate function:
function showContent(container) {
    if (container.is(":visible")) {
        // Hide - slide up.
        container.slideUp(500);
    } else {
        // Show - slide down.
        container.slideDown(500);
    }
}

I have also added a hideContent function that will hide any content divs as required:
function hideContent(div1, div2, div3) {
    div1.slideUp(500);
    div2.slideUp(500);
    div3.slideUp(500);
}

I have also refactored your CSS as again there was some duplication. So I have added a content class to your content divs:

First div

And added the content class to your CSS. So if you need to make changes to this CSS, you only have to do it in the one place rather than for each of your content divs:
.content {
    height: 500px;
    width: 300px;
    border-width: 1px;
    border-style: solid;
    bottom: 0px;
    position: fixed;
    display: none;
}

I have added a new function to enable / disable the buttons when clicked:
function setButtons(inactiveBtn) {
    $('.button').prop('disabled', false);
    inactiveBtn.prop('disabled', true);
}

New demo here.

A: Give this a try:
jQuery(function($) {

    $('[class^=button]').on('click', function(e) {
        // prevent default behavior
        e.preventDefault();

        // retrieving button number
        var buttonNb = $(this).attr('class').substr($(this).attr('class').length - 1); // assuming the button has only one class which is 'button*' (where * is either 1 or 2)

        // assigning variables
        if(buttonNb == 1) {
            var $contUp = $('#containerz');
            var $contDown = $('#containers');
        } else if(buttonNb == 2) {
            var $contUp = $('#containers');
            var $contDown = $('#containerz');
        }

        // do the job
        if($contUp.is(':visible')) {
            $contUp.slideUp(500, function() {
                $contDown.slideDown(500);
            });
        } else {
            $contDown.slideDown(500, function() {
                $contUp.slideUp(500);
            });
    });

});

A: I think you are looking for this
Working Fiddle,
http://jsfiddle.net/gwe81ka0/1/
http://jsfiddle.net/co0s5zyh/
Code1:
var containerz = $("#containerz");
var containers = $("#containers");

 $( "#button1" ).click(function(){

          if (containerz.is( ":visible" )){
              containerz.slideUp( "slow",function(){
                            if (containers.is( ":hidden" )){
                                    containers.slideDown( "slow" );
                            }
                                 }
                                );
          }
 //         if (containers.is( ":hidden" )){
  //            containers.slideDown( "slow" );
  //        }
          }
   );
$( "#button2" ).click(function(){

          if (containers.is( ":visible" )){
              containers.slideUp("slow",function(){
                           if (containerz.is( ":hidden" )){
                                containerz.slideDown("slow");
                           }
                               }
                                );
          }
//          if (containerz.is( ":hidden" )){
//              containerz.slideDown("slow");
//          }
          }
   );

Code2:
var containerz = $("#containerz");
var containers = $("#containers");

 $( "#button1" ).click(function(){

          if (containers.is( ":hidden" )){
              containers.css('z-index',99);
              containerz.css('z-index',98);
              containers.slideDown( "slow",function(){
                            if (containerz.is( ":visible" )){
                                       containerz.slideUp( "slow" );
                            }
                                      }
                                  );
         }
          }
   );
$( "#button2" ).click(function(){

         if (containerz.is( ":hidden" )){
              containerz.css('z-index',99);
              containers.css('z-index',98);
              containerz.slideDown( "slow",function(){
                            if (containers.is( ":visible" )){
                                       containers.slideUp( "slow" );
                            }
                                      }
                                  );
         }
          }
   );


text:
Q: Visual C++ : create icon for application in other resource I have an picture (file type is png) and I want to make this as an icon for my app in Visual C++.
When I add from resource: if I choose Icon>new: will be has a editor icon (that not what I want). If I choose import, it will create an other folder contain my picture import, and I cannot use it as an icon.
So, who help me about this, please.
thanks :)

A: What about copy-paste image data into new icon resource?

A: Stop fiddling around an image you might like. Search Download appropriate icons from many of sites available. Few of them:

*

*www.freeiconsweb.com

*www.iconarchive.com

*www.bestfreeicons.com

*www.iconfinder.com

*www.freeiconsdownload.com


text:
Q: How to make REST calls to Shopware I enabled the REST call for my admin (cleared the cache and logged out).
I do not understand this instruction:
"You will get a randomly generated API access key, which needs to be included in your API requests for authentication."
In the same page for authentication it says, that i should add this to the header:
Authorization: Basic c2gvcHp3BXJl (this is the encoded username and password)
What should I do with the generated API access key?

A: The API-key is used as password. You can check it by accessing /api/orders (e.g.) via Browser. The credentials are the same (username + Apikey).
Shopware provides an example on how to do this in php:
https://developers.shopware.com/developers-guide/rest-api/#using-the-rest-api-in-your-own-application
https://developers.shopware.com/developers-guide/rest-api/#authentication
The API key will be generated in the backend-user module.


text:
Q: why I got nilError while saving managedObjectContext? I have some views that transfer information.
Finally i want to save the data but i get "nilError".
And how can I have the sheets faded in from right to left?
I'm new at this but I hope someone can help.
Model:
import Foundation
import CoreData

public class Test: NSManagedObject, Identifiable {
    @NSManaged public var name: String?
    @NSManaged public var message: String?
}

.xcdatamodel:
Attributes: "name" and "message" both String and "Class.name": test, "Module": Current Product Module, "Codegen": Manual/None
(Sorry, I'm not allowed to upload images)
Views:
import SwiftUI

struct ThirdView: View {
    @Environment(\.managedObjectContext) var managedObjectContext
    @Environment(\.presentationMode) var presentationMode

    @State private var showingSheet = false

    let name: String
    let message: String

    var body: some View {
        List{
            Text(name + ": " + message)
            Button("Dismiss"){
                self.saveThis()
                self.presentationMode.wrappedValue.dismiss()
            }
        }
    }

    func saveThis(){
        let newEntry = Test(context: self.managedObjectContext)

        newEntry.message = self.message
        newEntry.name = self.name

        do {
            try self.managedObjectContext.save()
        } catch {
            print(error)
        }
    }
}

struct SecondView: View {
    @Environment(\.presentationMode) var presentationMode
    @State private var showingSheet = false

    let name: String?
    @State private var message: String = ""

    var body: some View{
        List{
            TextField("Message: ", text: $message)

            Button("Next"){
                self.showingSheet.toggle()
            }.sheet(isPresented: $showingSheet){
                ThirdView(name: self.name!, message: self.message)
            }
        }
    }
}

struct NewEntry: View {
    @State private var showingSheet = false

    var body: some View {
        Button("Show Sheet"){
            self.showingSheet.toggle()
        }
        .sheet(isPresented: $showingSheet){
            SecondView(name: "Fritz")
        }
    }
}

... I have one other Entity in my xcdatamodel and some other model class to save other information and there I have no problems.
It might be stupid, but is it possible, that I can only have one of these managed objects?

A: The .sheet modifier introduces new view hierarchy so you have to set any required environment value to view in sheet explicitly (in this case context), like
}.sheet(isPresented: $showingSheet){
    ThirdView(name: self.name!, message: self.message)
       .environment(\.managedObjectContext, managedObjectContext)
}

and so declare it in
struct SecondView: View {
    @Environment(\.managedObjectContext) var managedObjectContext
    @Environment(\.presentationMode) var presentationMode
...


text:
Q: Contour Integration cauchy integration formula If I have the integrand

$$\frac{e{^z}^2}{(2z+i)(z+3i)^2}$$

for the circles with centre $a$ radius $2$.
I know the integrand has a single pole at  $z=-i/2$ and a double pole at $z=-3i$
My question is for centres $a=3,5,7i$ how do I know if the poles lie inside the circle to enable use of the Cauchy Integral formula, I'm getting confused as there are $i$ terms. Thank you.

A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$

$\ds{a \in \braces{3,5,7\ic}}$.

\begin{align}
&\bbox[10px,#ffd]{\ds{\oint_{\verts{z - a}\ =\ 2}{\expo{z^{2}} \over
\pars{2z + \ic}\pars{z + 3\ic}^{2}}\,\dd z}} =
{1 \over 2}\expo{a^{2}}\oint_{\verts{z}\ =\ 2}{\expo{z^{2} + 2az} \over
\bracks{z - \pars{-a - \ic/2}}\bracks{z -\pars{-a - 3\ic}}^{\, 2}}\,\dd z
\end{align}

$\ds{a \in \braces{3,5,7\ic} \implies \verts{-a - {\ic \over 2}} > 2}$ and
  $\ds{\verts{-a - 3\ic} > 2}$. So, the above integral
  $\ds{\color{red}{\texttt{vanishes out}}}$.


text:
Q: shell how to find last entry in /etc/passwd I am trying to write my own shell script to add a user in Linux. I don´t want to use useradd. So how to I find the last entry in passwd ? I would like to check the USER ID, and GROUP ID. So i can make +1 to UISER ID and +1 Group ID.
Or is there any possibility to make a grep on the last entry in a file?
e.G.
simpson:x:103:103:Lisa Simpson, etc...

A: Just use tail:
tail -1 /etc/passwd

A: With sed:
sed -n '$'p /etc/passwd

http://www.gnu.org/software/sed/manual/sed.html#tail


text:
Q: Google Analytics tag with wrong GTM ID I have an application with GTM head snippet. And GTM is set up with Universal Analytics tags for GA.
Everything was working great for months
2/22 - Data from GTM was not being sent to GA and I noticed a new console error
analytics.js:3 GET https://www.google-analytics.com/gtm/js?id=GTM-NZ9RDTS&t=gtm1&cid=116215814.1516126796 net::ERR_ABORTED
The GTM ID is not my GTM ID and I am not sure where its coming from.. any thoughts?

A: I am new to GTM, but I found another reason why there could be an unknown tag registered in GA. According to this discussion post on the community, it is possible that sometimes, a referral link could trigger GA to register foreign GTMs on your GA.

A: I had the same experience - new Google Optimize container with draft experiment. The Optimize container has been configured to be served through GTM and GTM container has been published. Whenever tried to check the integration an error appeared. Through Chrome Inspect I saw 404 for www.google-analytics.com/gtm/js?id=
The solution was to publish the experiment. Then immediately unpublished (ended) the experiment as it was not properly configured. The errors related to Optimize container have disappeared.


text:
Q: App store approval with modified UISegmentedControl I have modified a UISegmentedControl so that it is vertical instead of horizontal- it looks like this:

Will using it this way cause my app to get rejected by Apple? If yes, what control would you suggest using instead? Thanks!

A: As long as you are not using private APIs to do this I would say you are fine. Apple strongly suggests following the Human Interface Guideline but there are modified controls like this all over the AppStore. I highly doubt you'd get rejected for your custom design.


text:
Q: Android Bundle extra is getting null keys i am trying to do a simple information transition between activities.
The problem is, in the received activity I am getting stuck in get.Extras() == null
here is the receive activity code:
helloName = (TextView) findViewById(surfaceName);
Bundle extra = getIntent().getExtras();
String nome = extra.getString("keyName");
System.out.println(nome) ;   #PRINTING =null
helloName.setText("Olá "+nome);

Here is my passing information Activity:
Editable nome = name.getText();
System.out.println(nome);
Intent intent = new Intent(HelloActivity.this, MainActivity.class);
intent.putExtra("keyName",nome);
System.out.println(intent.getExtras());
startActivity(intent);

A: try
   Editable nome = name.getText();
   System.out.println(nome);
   Intent intent = new Intent(HelloActivity.this, MainActivity.class);
   intent.putExtra("keyName",nome.toString());
   System.out.println(intent.getExtras());
   startActivity(intent);


text:
Q: show username in infopath form I need to show the user full name in InfoPath form. I tried the webservice and data connection for User Information list but still not getting. Can any one show me the steps he/she follow to show display name.

A: To get the current user's display name, assuming you have the User Information data connection already set up, I create a rule that runs when the form loads. The rule doesn't have any conditions, just to run when the form loads. The following actions are added to the rule:

*

*Set a field's value: select the field for User Information List-->queryFields-->Account

*Select infopath's function userName() as the value

*Then in the same rule I add the action to query the data connection for the User Information List.

In the field that I want to add the current user's display name to I add the default value of the User Information List-->dataFields-->Name.

At this point you don't have to use the Name field as I suggested, you can add any dataField value that you are wanting to retrieve information for the current user. Make sure that you checkmark "Refresh value when formula is recalculated" so that this value is updated each time the form is opened.

Don't be alarmed if the name that appears in the value is different from what you selected on the  user information list. What is displayed on the value portion often changes to the field's properties name that is set on sharepoint. The end result is still the same though.


text:
Q: redirect after form submit jquery I have to submit a form with target = _blank and redirect the page to other.
HTML
<form id="registration_form" name="registration_form" method="post" action="actionurl" target="_blank">
    <input type="button" name="submit" id="submit" value="Submit" />
</form>

JQUERY
$(document).ready( function()
{
   $('#registration_form').submit( function(e)
   {
      var flag=validate();
      if(flag)
          $(location).attr('href',redirectionurl);
      return flag;
   });

   $("#submit").click(function(){
      $('#registration_form').submit(); // this triggers the submit event
   });
});

If i change the button type to SUBMIT form submitting as per validation flag but redirection doesn't work.
If i use BUTTON instead of submit redirection takes place but form not submitting.
Where i have been wrong. Help.
Thank you.

A: I think you do it in the hard way, since you define the target as _blank, but you DO submit the forum later, so i suggest you to do the validation on your server side and not on the jquery. the html code should look like that:
<form id="registration_form" name="registration_form" method="post" action="actionurl" target="_blank">
    <input type=hidden name="flag_input" value="false">
    <input type="button" name="submit" id="submit" value="Submit" />
</form>

And the jquery code:
$(document).ready( function()
{
   $('#registration_form').submit( function(e)
   {
      var flag=validate();
      if(flag)
          $("#flag_input").val("true")
   });

   $("#submit").click(function(){
      $('#registration_form').submit();
   });
});

And then the server get the flag_input - if its true, it will redirect, if not, the user will have to fill the forum again. if you don't want redirect at all, you can use ajax.
EDIT:
and on the server side:(i don't know what langues you use but the basic is like that:)
if (flag_input==true) - generate PDF and redirect to X
else - redirect to Y(the forum page)
Let me know if that helped.
Goodluck!


text:
Q: What does "assigns" do in Ruby on Rails? I am currently attempt to learn Ruby on Rails, and the testing framework RSpec. What does assigns do in this RSpec test?
 describe "GET index" do
    it "assigns all mymodel as @mymodel" do
      mymodel = Factory(:mymodel)
      get :index
      assigns(:mymodels).should eq([mymodel])
    end
  end

A: assigns simply checks the value of the instance variables you set in your controller.
Here it checks @mymodels.