问:
Height of linear layout doesn't increase as the width of linear layout increase in android studio
I am looking for a solution that if the width of the linear layout increases the height increases accordingly.

I want the height to increase as well when the width of the linear layout increase. Is it possible to have a solution using XML only.

```<code>

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/grafiti"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ScrollView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:layout_marginEnd="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginBottom="1dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="25sp"
                app:cardCornerRadius="45dp"
                app:cardElevation="5dp">

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

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="1"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/textView"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:fontFamily="@font/alata"
                            android:text="BASE"
                            android:textAlignment="center"
                            android:textColor="@color/white"
                            android:textSize="48sp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="2"
                        android:orientation="horizontal"
                        android:visibility="invisible"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="2"
                        android:orientation="vertical"
                        android:visibility="visible">

                        <ImageView
                            android:id="@+id/imageView6"
                            android:layout_width="match_parent"
                            android:layout_height="250dip"
                            android:scaleType="centerCrop"
                            app:srcCompat="@drawable/tictactoemain" />
                    </LinearLayout>

                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="3">

                        <ImageView
                            android:id="@+id/gifImageView"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:adjustViewBounds="true"
                            android:scaleType="centerCrop"
                            android:src="@drawable/tictactoe_gif"
                            android:visibility="visible"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent" />

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent">

                            <LinearLayout
                                android:id="@+id/roundstab"
                                android:layout_width="match_parent"
                                android:layout_height="120sp"
                                android:background="@color/transparent"
                                android:orientation="horizontal"
                                android:visibility="visible">

                                <Space
                                    android:layout_width="0dp"
                                    android:layout_height="wrap_content"
                                    android:layout_weight="1" />

                                <androidx.cardview.widget.CardView
                                    android:layout_width="0dp"
                                    android:layout_height="wrap_content"
                                    android:layout_marginTop="25dp"
                                    android:layout_marginBottom="5dp"
                                    android:layout_weight="10"
                                    app:cardBackgroundColor="@color/card_grey"
                                    app:cardCornerRadius="15sp"
                                    app:cardElevation="5sp">

                                    <LinearLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="50sp"
                                        android:layout_marginLeft="10sp"
                                        android:layout_marginTop="10sp"
                                        android:layout_marginBottom="8sp"
                                        android:orientation="horizontal">

                                        <ImageButton
                                            android:id="@+id/imageButton2"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_weight="2"
                                            android:background="@color/transparent"
                                            android:scaleType="fitCenter"
                                            app:srcCompat="@drawable/minus" />

                                        <com.google.android.material.textfield.TextInputLayout
                                            android:layout_width="0dp"
                                            android:layout_height="match_parent"
                                            android:layout_weight="2"
                                            android:background="@drawable/custom_spinner_border"
                                            app:boxBackgroundMode="none"
                                            app:errorEnabled="false">

                                            <com.google.android.material.textfield.TextInputEditText
                                                android:layout_width="match_parent"
                                                android:layout_height="wrap_content"
                                                android:maxLines="1"
                                                android:padding="0dp"
                                                android:text="5"
                                                android:textAlignment="center" />
                                        </com.google.android.material.textfield.TextInputLayout>

                                        <ImageButton
                                            android:id="@+id/imageButton3"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_weight="2"
                                            android:background="@color/transparent"
                                            android:scaleType="fitCenter"
                                            app:srcCompat="@drawable/plus" />

                                    </LinearLayout>
                                </androidx.cardview.widget.CardView>

                                <Space
                                    android:layout_width="0dp"
                                    android:layout_height="wrap_content"
                                    android:layout_weight="1" />

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="250sp"
                                android:layout_weight="6"
                                android:orientation="horizontal">

                                <androidx.constraintlayout.widget.ConstraintLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:layout_weight="1">

                                    <Button
                                        android:id="@+id/button3"
                                        android:layout_width="100sp"
                                        android:layout_height="50sp"
                                        android:layout_weight="1"
                                        android:text="START"
                                        app:cornerRadius="45sp"
                                        app:layout_constraintBottom_toBottomOf="parent"
                                        app:layout_constraintEnd_toEndOf="parent"
                                        app:layout_constraintHorizontal_bias="0.498"
                                        app:layout_constraintStart_toStartOf="parent"
                                        app:layout_constraintTop_toTopOf="parent"
                                        app:layout_constraintVertical_bias="0.697" />
                                </androidx.constraintlayout.widget.ConstraintLayout>

                            </LinearLayout>

                        </LinearLayout>

                    </androidx.constraintlayout.widget.ConstraintLayout>

                </LinearLayout>

            </androidx.cardview.widget.CardView>
        </ScrollView>

</code>```

Any solution for the height?

 The image on the right is where the issue is. the height remains constant while the width increases due to which the screen streches.

Body:
I am looking for a solution that if the width of the linear layout increases the height increases accordingly.

I want the height to increase as well when the width of the linear layout increase. Is it possible to have a solution using XML only.

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:background="@drawable/grafiti"
        android:orientation="vertical"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">

        <ScrollView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginStart="1dp"
            android:layout_marginLeft="1dp"
            android:layout_marginTop="1dp"
            android:layout_marginEnd="1dp"
            android:layout_marginRight="1dp"
            android:layout_marginBottom="1dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_margin="25sp"
                app:cardCornerRadius="45dp"
                app:cardElevation="5dp">

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

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="1"
                        android:orientation="horizontal">

                        <TextView
                            android:id="@+id/textView"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:fontFamily="@font/alata"
                            android:text="BASE"
                            android:textAlignment="center"
                            android:textColor="@color/white"
                            android:textSize="48sp"
                            android:textStyle="bold" />
                    </LinearLayout>

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="2"
                        android:orientation="horizontal"
                        android:visibility="invisible"
                        app:layout_constraintBottom_toBottomOf="parent"
                        app:layout_constraintEnd_toEndOf="parent"
                        app:layout_constraintStart_toStartOf="parent"
                        app:layout_constraintTop_toTopOf="parent" />

                    <LinearLayout
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="2"
                        android:orientation="vertical"
                        android:visibility="visible">

                        <ImageView
                            android:id="@+id/imageView6"
                            android:layout_width="match_parent"
                            android:layout_height="250dip"
                            android:scaleType="centerCrop"
                            app:srcCompat="@drawable/tictactoemain" />
                    </LinearLayout>

                    <androidx.constraintlayout.widget.ConstraintLayout
                        android:layout_width="match_parent"
                        android:layout_height="0dp"
                        android:layout_weight="3">

                        <ImageView
                            android:id="@+id/gifImageView"
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:adjustViewBounds="true"
                            android:scaleType="centerCrop"
                            android:src="@drawable/tictactoe_gif"
                            android:visibility="visible"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent" />

                        <LinearLayout
                            android:layout_width="match_parent"
                            android:layout_height="match_parent"
                            android:orientation="vertical"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintEnd_toEndOf="parent"
                            app:layout_constraintStart_toStartOf="parent"
                            app:layout_constraintTop_toTopOf="parent">

                            <LinearLayout
                                android:id="@+id/roundstab"
                                android:layout_width="match_parent"
                                android:layout_height="120sp"
                                android:background="@color/transparent"
                                android:orientation="horizontal"
                                android:visibility="visible">

                                <Space
                                    android:layout_width="0dp"
                                    android:layout_height="wrap_content"
                                    android:layout_weight="1" />

                                <androidx.cardview.widget.CardView
                                    android:layout_width="0dp"
                                    android:layout_height="wrap_content"
                                    android:layout_marginTop="25dp"
                                    android:layout_marginBottom="5dp"
                                    android:layout_weight="10"
                                    app:cardBackgroundColor="@color/card_grey"
                                    app:cardCornerRadius="15sp"
                                    app:cardElevation="5sp">

                                    <LinearLayout
                                        android:layout_width="match_parent"
                                        android:layout_height="50sp"
                                        android:layout_marginLeft="10sp"
                                        android:layout_marginTop="10sp"
                                        android:layout_marginBottom="8sp"
                                        android:orientation="horizontal">

                                        <ImageButton
                                            android:id="@+id/imageButton2"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_weight="2"
                                            android:background="@color/transparent"
                                            android:scaleType="fitCenter"
                                            app:srcCompat="@drawable/minus" />

                                        <com.google.android.material.textfield.TextInputLayout
                                            android:layout_width="0dp"
                                            android:layout_height="match_parent"
                                            android:layout_weight="2"
                                            android:background="@drawable/custom_spinner_border"
                                            app:boxBackgroundMode="none"
                                            app:errorEnabled="false">

                                            <com.google.android.material.textfield.TextInputEditText
                                                android:layout_width="match_parent"
                                                android:layout_height="wrap_content"
                                                android:maxLines="1"
                                                android:padding="0dp"
                                                android:text="5"
                                                android:textAlignment="center" />
                                        </com.google.android.material.textfield.TextInputLayout>

                                        <ImageButton
                                            android:id="@+id/imageButton3"
                                            android:layout_width="0dp"
                                            android:layout_height="wrap_content"
                                            android:layout_weight="2"
                                            android:background="@color/transparent"
                                            android:scaleType="fitCenter"
                                            app:srcCompat="@drawable/plus" />

                                    </LinearLayout>
                                </androidx.cardview.widget.CardView>

                                <Space
                                    android:layout_width="0dp"
                                    android:layout_height="wrap_content"
                                    android:layout_weight="1" />

                            </LinearLayout>

                            <LinearLayout
                                android:layout_width="match_parent"
                                android:layout_height="250sp"
                                android:layout_weight="6"
                                android:orientation="horizontal">

                                <androidx.constraintlayout.widget.ConstraintLayout
                                    android:layout_width="match_parent"
                                    android:layout_height="match_parent"
                                    android:layout_weight="1">

                                    <Button
                                        android:id="@+id/button3"
                                        android:layout_width="100sp"
                                        android:layout_height="50sp"
                                        android:layout_weight="1"
                                        android:text="START"
                                        app:cornerRadius="45sp"
                                        app:layout_constraintBottom_toBottomOf="parent"
                                        app:layout_constraintEnd_toEndOf="parent"
                                        app:layout_constraintHorizontal_bias="0.498"
                                        app:layout_constraintStart_toStartOf="parent"
                                        app:layout_constraintTop_toTopOf="parent"
                                        app:layout_constraintVertical_bias="0.697" />
                                </androidx.constraintlayout.widget.ConstraintLayout>

                            </LinearLayout>

                        </LinearLayout>

                    </androidx.constraintlayout.widget.ConstraintLayout>

                </LinearLayout>

            </androidx.cardview.widget.CardView>
        </ScrollView>

Any solution for the height?

 The image on the right is where the issue is. the height remains constant while the width increases due to which the screen streches.


来源: stackexchange

问:
AttributeError: 'EntryPoints' object has no attribute 'get' with superset
I am installing superset and at the level of superset db upgrade I got an error saying: AttributeError: 'EntryPoints' object has no attribute 'get'

Error:

```<code>python datavisual\Scripts\superset db upgrade
Traceback (most recent call last):
  File "datavisual\Scripts\superset", line 18, in <module>
    from superset.cli import superset
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\superset\__init__.py", line 21, in <module>
    from superset.app import create_app
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\superset\app.py", line 29, in <module>
    from superset.extensions import (
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\superset\extensions.py", line 126, in <module>
    celery_app = celery.Celery()
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\local.py", line 470, in __getattr__
    [name])
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\app\__init__.py", line 2, in <module>
    from celery import _state
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\_state.py", line 15, in <module>
    from celery.utils.threads import LocalStack
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\utils\__init__.py", line 16, in <module>
    from .nodenames import nodename, nodesplit, worker_direct
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\utils\nodenames.py", line 6, in <module>
    from kombu.entity import Exchange, Queue
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\kombu\entity.py", line 7, in <module>
    from .serialization import prepare_accept_content
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\kombu\serialization.py", line 440, in <module>
    for ep, args in entrypoints('kombu.serializers'):  # pragma: no cover
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\kombu\utils\compat.py", line 82, in entrypoints
    for ep in importlib_metadata.entry_points().get(namespace, [])
AttributeError: 'EntryPoints' object has no attribute 'get'
</code>```

ContentLicense: CC BY-SA 4.0

Body:
I am installing superset and at the level of superset db upgrade I got an error saying: AttributeError: 'EntryPoints' object has no attribute 'get'

Error:

python datavisual\Scripts\superset db upgrade
Traceback (most recent call last):
  File "datavisual\Scripts\superset", line 18, in <module>
    from superset.cli import superset
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\superset\__init__.py", line 21, in <module>
    from superset.app import create_app
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\superset\app.py", line 29, in <module>
    from superset.extensions import (
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\superset\extensions.py", line 126, in <module>
    celery_app = celery.Celery()
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\local.py", line 470, in __getattr__
    [name])
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\app\__init__.py", line 2, in <module>
    from celery import _state
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\_state.py", line 15, in <module>
    from celery.utils.threads import LocalStack
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\utils\__init__.py", line 16, in <module>
    from .nodenames import nodename, nodesplit, worker_direct
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\celery\utils\nodenames.py", line 6, in <module>
    from kombu.entity import Exchange, Queue
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\kombu\entity.py", line 7, in <module>
    from .serialization import prepare_accept_content
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\kombu\serialization.py", line 440, in <module>
    for ep, args in entrypoints('kombu.serializers'):  # pragma: no cover
  File "C:\Users\user\Desktop\superset\datavisual\lib\site-packages\kombu\utils\compat.py", line 82, in entrypoints
    for ep in importlib_metadata.entry_points().get(namespace, [])
AttributeError: 'EntryPoints' object has no attribute 'get'


问:
I cannot access to the Monitor of Colyseus
I folowed a tutorial Phaser and Colyseus multiplayer game, I saw others can access to the monitor of the Colyseus, but I can not.

I used Express to write api for Colyseus, here my code:

```<code>import http from 'http'
import express from 'express'
import cors from 'cors'
import { Server } from 'colyseus'
import { monitor } from "@colyseus/monitor";

const port = Number(process.env.PORT || 2567)
const app = express()

app.use(cors())
app.use(express.json())

const server = http.createServer(app)
const gameServer = new Server({
    server,
 })

 //register colyseus monitor
app.use("/colyseus", monitor());

 gameServer.listen(port)
 console.log(`Listening on ws://localhost:${port}`)
</code>```

I followed the tutorial, in this case he can access to the monitor but I am not.
Links tutorial: https://www.youtube.com/watch?v=5HESa0Ibq8E&list=PLNwtXgWIx3rhOmsJOkUFRiFQg8pPFPDqy
https://www.npmjs.com/package/@colyseus/monitor
https://docs.colyseus.io/colyseus/tools/monitor/

I got this error when I was opening the localhost 2567 on browser:

```<code>Cannot GET /colyseus/
</code>```

Body:
I folowed a tutorial Phaser and Colyseus multiplayer game, I saw others can access to the monitor of the Colyseus, but I can not.

I used Express to write api for Colyseus, here my code:

import http from 'http'
import express from 'express'
import cors from 'cors'
import { Server } from 'colyseus'
import { monitor } from "@colyseus/monitor";

const port = Number(process.env.PORT || 2567)
const app = express()

app.use(cors())
app.use(express.json())

const server = http.createServer(app)
const gameServer = new Server({
    server,
 })

 //register colyseus monitor
app.use("/colyseus", monitor());

 gameServer.listen(port)
 console.log(`Listening on ws://localhost:${port}`)

I followed the tutorial, in this case he can access to the monitor but I am not.
Links tutorial: https://www.youtube.com/watch?v=5HESa0Ibq8E&list=PLNwtXgWIx3rhOmsJOkUFRiFQg8pPFPDqy
https://www.npmjs.com/package/@colyseus/monitor
https://docs.colyseus.io/colyseus/tools/monitor/

I got this error when I was opening the localhost 2567 on browser:

Cannot GET /colyseus/


问:
$_FILES empty when sending Image with POST
I want to do pretty simple thing. Send image via HTTP to my Php Backend. However the $_FILES array remains empty.

My FrontEnd is looking like this:

```<code>const formData = new FormData();
    formData.append('image', this.newPhoto);
await fetch('http://localhost:8080/addArticle', {
        method: 'POST',
        headers: {
          'Content-Type': 'multipart/form-data',
          'Access-Control-Allow-Origin': '*',
          'Access-Control-Allow-Headers': '*',
        },
        body: formData,
      })
        .then((response) => console.log(response))
        .catch((error) => console.log(error));

</code>```

My Payload in Network Tab on Dev Tools is looking like this: First time sending Images, so not really sure whether it looks correctly.

And on server side just simply try to see this files now via

```<code>var_dump($_FILES);
</code>```

https://i.stack.imgur.com/KrN63.png
What am i missing?

In HTML it looks like this. Iam usinng Vuetify libarry for Vue:

```<code><v-file-input v-model="newPhoto" show-size accept="image/*" label="Photo"></v-file-input>
</code>```

Console log of example photo:
i.stack.imgur.com/mpy9d.png

Body:
I want to do pretty simple thing. Send image via HTTP to my Php Backend. However the $_FILES array remains empty.

My FrontEnd is looking like this:

const formData = new FormData();
    formData.append('image', this.newPhoto);
await fetch('http://localhost:8080/addArticle', {
        method: 'POST',
        headers: {
          'Content-Type': 'multipart/form-data',
          'Access-Control-Allow-Origin': '*',
          'Access-Control-Allow-Headers': '*',
        },
        body: formData,
      })
        .then((response) => console.log(response))
        .catch((error) => console.log(error));

My Payload in Network Tab on Dev Tools is looking like this: First time sending Images, so not really sure whether it looks correctly.

And on server side just simply try to see this files now via

var_dump($_FILES);

https://i.stack.imgur.com/KrN63.png
What am i missing?

In HTML it looks like this. Iam usinng Vuetify libarry for Vue:

<v-file-input v-model="newPhoto" show-size accept="image/*" label="Photo"></v-file-input>

Console log of example photo:
i.stack.imgur.com/mpy9d.png


问:
I am struggling to get a customized hovertemplate on plotly parcats chart
So I tried to put hovertemplate inside go.Parcats but not sure which way to put it. I want something like when you hover on any line it shuold show the custom discription like names of attributes and count and percentage on hover.

Also is there any wat to blank out those labels at the bottom of the chart so that it looks less busy and nicer but also when you hover on it shuold show up details. I know it's too much of customization but hoping it's doable.

```<code>dimensions.append(dict(values = df[dim], label = dim, categoryarray = df[dim].unique(), categoryorder = 'array', ticktext = slabel))

fig = go.Figure(data = [go.Parcats(dimensions= dimensions,
                                    line = {'color': color, 'colorscale':colorscale,},
                                    )]
          )
</code>```

Body:
So I tried to put hovertemplate inside go.Parcats but not sure which way to put it. I want something like when you hover on any line it shuold show the custom discription like names of attributes and count and percentage on hover.

Also is there any wat to blank out those labels at the bottom of the chart so that it looks less busy and nicer but also when you hover on it shuold show up details. I know it's too much of customization but hoping it's doable.

dimensions.append(dict(values = df[dim], label = dim, categoryarray = df[dim].unique(), categoryorder = 'array', ticktext = slabel))

fig = go.Figure(data = [go.Parcats(dimensions= dimensions,
                                    line = {'color': color, 'colorscale':colorscale,},
                                    )]
          )


问:
multi file-upload fields in one model
I need something like this:

In one form there will be several file upload fields with multi uploads.

I would make it as single field, but I need then to filter it. E.g:

I will need to display on frontend all the file1, not file1 - file2 - file3 combined.

So, I Need model like this (but that works only for a single file upload)

```<code>class TestModel(models.Model):
    #info 1
    exp_date = models.DateField(default=None, blank=True, null=True)
    file1 = models.FileField(upload_to="1/", blank=True, null=True)#multi files

    #info 2
    member_number = models.CharField(max_length=50, default=None)
    file2 = models.FileField(upload_to="1/", blank=True, null=True)#multi files

    #info 3
    member_exp_date = models.CharField(max_length=50, default=None)
    file3 = models.FileField(upload_to="1/", blank=True, null=True)#multi files
</code>```

But it has to have multi file uploads in each "file upload" field, therefore I have to create another model like this for every file field

```<code>class FilesOne(models.Model):
    file = models.FileField(upload_to="%Y-%m-%d/", blank=True, null=True)
    files_key = models.ForeignKey('TestModel', on_delete=models.CASCADE,
default=None, null=True)

class FilesTwo(models.Model):
    file = models.FileField(upload_to="%Y-%m-%d/", blank=True, null=True)
    files_key = models.ForeignKey('TestModel', on_delete=models.CASCADE,
    default=None, null=True)
...
</code>```

and in views make for loop and run "create-objects" 'file-number' Times for every field like this:

```<code>        add_files = request.FILES.getlist("file")
        for i in add_files :
            FilesOne.objects.create(files_key=user.driver, file=i)
</code>```

So, is there any good solution to make it happen?

Title: multi file-upload fields in one model

Body:
I need something like this:

In one form there will be several file upload fields with multi uploads.

I would make it as single field, but I need then to filter it. E.g:

I will need to display on frontend all the file1, not file1 - file2 - file3 combined.

So, I Need model like this (but that works only for a single file upload)

class TestModel(models.Model):
    #info 1
    exp_date = models.DateField(default=None, blank=True, null=True)
    file1 = models.FileField(upload_to="1/", blank=True, null=True)#multi files

    #info 2
    member_number = models.CharField(max_length=50, default=None)
    file2 = models.FileField(upload_to="1/", blank=True, null=True)#multi files

    #info 3
    member_exp_date = models.CharField(max_length=50, default=None)
    file3 = models.FileField(upload_to="1/", blank=True, null=True)#multi files

But it has to have multi file uploads in each "file upload" field, therefore I have to create another model like this for every file field

class FilesOne(models.Model):
    file = models.FileField(upload_to="%Y-%m-%d/", blank=True, null=True)
    files_key = models.ForeignKey('TestModel', on_delete=models.CASCADE,
default=None, null=True)

class FilesTwo(models.Model):
    file = models.FileField(upload_to="%Y-%m-%d/", blank=True, null=True)
    files_key = models.ForeignKey('TestModel', on_delete=models.CASCADE,
    default=None, null=True)
...

and in views make for loop and run "create-objects" 'file-number' Times for every field like this:

        add_files = request.FILES.getlist("file")
        for i in add_files :
            FilesOne.objects.create(files_key=user.driver, file=i)

So, is there any good solution to make it happen?


问:
how to make this beautiful routing switching effects via react.js or react-native?

video is here:
https://www.pinterest.com/pin/576531189812450991/

very beautiful routing switching effects, but can't find the react.js solution.

try to use react-transition-group, but can't do this.

any ideas? thank you very much！


问:
Add mvn classifier for POM packaging
Today Maven allows the creations of various versions of a JAR using the classifier option of Maven JAR plugin. Just want to know if there's any plugins to do the same for POM packaging? So that I can have multiple versions of the same POM artefacts distinguished by classifiers.</p>

Title: Add mvn classifier for POM packaging


问:
the file does not match your project config: src\index.html
I am trying to upgrade TSLint to ESLint but having below error:

0:0  error  Parsing error: "parserOptions.project" has been set for
@typescript-eslint/parser. The file does not match your project
config: src\index.html. The extension for the file (.html) is
non-standard. You should add "parserOptions.extraFileExtensions" to
your config

I tried other answers related to this one but no luck.

Here is my .eslintrc.js

```<code>module.exports = {
env: {
    browser: true,
    node: true,
  },
  extends: [],
  ignorePatterns: ['projects/**/*', '/*.*'],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: 'tsconfig.json',
    sourceType: 'module',
  },
  // other rules ....
}
</code>```

What can be the possible solution for this, if I want to exclude the .html extension.

Body:
I am trying to upgrade TSLint to ESLint but having below error:

0:0  error  Parsing error: "parserOptions.project" has been set for
@typescript-eslint/parser. The file does not match your project
config: src\index.html. The extension for the file (.html) is
non-standard. You should add "parserOptions.extraFileExtensions" to
your config

I tried other answers related to this one but no luck.

Here is my .eslintrc.js

module.exports = {
env: {
    browser: true,
    node: true,
  },
  extends: [],
  ignorePatterns: ['projects/**/*', '/*.*'],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    project: 'tsconfig.json',
    sourceType: 'module',
  },
  // other rules ....
}

What can be the possible solution for this, if I want to exclude the .html extension.


问:
how to get the Airfow log in a Task using context?
I want to obtain all the logs generated by a task within an operator, in order to send it to Slack when an error occurs with the on_failure_callback method.

I want to get and send the Task INFO/ERROR/WARNING log using on_failure_callback. Can I access this data using the context? something Like context.get('dag').default_args['owner']

All this


问:
Linkedin FunCaptcha error: "Your noCAPTCHA user response code is missing or invalid"
https://www.youtube.com/watch?v=WND7Dve5OaU

I’m trying to automate Linkedin sign up with puppeteer, but I’m stuck on captcha.

I always get error "Your noCAPTCHA user response code is missing or invalid.", regardless of whether I’m trying to pass it manually ( with clicking on right answers in browser ) or with services like 2captcha on anticaptcha ( but they return a solution token, even if I set my proxy for solving ).

I tried to use different proxies and tried to disable proxies, but nothing helped.

I use random ( but actual ) user agents and stealth plugin. http://bot.sannysoft.com/ is all green, so it’s unlikely Linkedin identify me as bot.

A few months ago I didn't encounter this problem and always successfully passed the captcha.

Correct solution will be necessarily paid.


问:
How to read partitioned parquet data using Pandas
I have data in Azure blob storage which was written using PySpark, when it was written, a WeekStartDate field (Monday) was used for partitionBy i.e. df.write.partitionBy("WeekStartDate"). This  gives rise to a folder/file structure in Azure blob storage like this

```<code>container/MyTable/WeekStartDate=2020-09-28/
    hash0.gz.parquet
    ...
    hash(n-1).gz.parquet
container/MyTable/WeekStartDate=2020-10-05/
    hash0.gz.parquet
    ...
    hash(n-1).gz.parquet
container/MyTable/WeekStartDate=2020-10-12/
    hash0.gz.parquet
    ...
    hash(n-1).gz.parquet
container/MyTable/WeekStartDate=2020-10-19/
etc
</code>```

Now, say I want to read data for just WeekStartDate's 2020-09-28 and 2020-10-05.

Is there any way to do this in pandas without having to build up the two paths and then stitching together like

```<code>df1 = pd.read_parquet("MyTable/WeekStartDate=2020-09-28", storage_options=xxx)
df2 = pd.read_parquet("MyTable/WeekStartDate=2020-09-28", storage_options=xxx)

df = pd.concat((df1, df2))
</code>```

Body:
I have data in Azure blob storage which was written using PySpark, when it was written, a WeekStartDate field (Monday) was used for partitionBy i.e. df.write.partitionBy("WeekStartDate"). This  gives rise to a folder/file structure in Azure blob storage like this

container/MyTable/WeekStartDate=2020-09-28/
    hash0.gz.parquet
    ...
    hash(n-1).gz.parquet
container/MyTable/WeekStartDate=2020-10-05/
    hash0.gz.parquet
    ...
    hash(n-1).gz.parquet
container/MyTable/WeekStartDate=2020-10-12/
    hash0.gz.parquet
    ...
    hash(n-1).gz.parquet
container/MyTable/WeekStartDate=2020-10-19/
etc

Now, say I want to read data for just WeekStartDate's 2020-09-28 and 2020-10-05.

Is there any way to do this in pandas without having to build up the two paths and then stitching together like

df1 = pd.read_parquet("MyTable/WeekStartDate=2020-09-28", storage_options=xxx)
df2 = pd.read_parquet("MyTable/WeekStartDate=2020-09-28", storage_options=xxx)

df = pd.concat((df1, df2))


问:
Firebase Realtime rules using auth.token.phoneNumber
I am having a problem writing Security Rules for my Firebase Realtime database, I have read the documentation but it was not really helpful in my case. As you can see below that the number stored in the database doesn't contain the country code

Realtime database Structure:

but the number that I am getting in firebase rules from auth.token.phonenNumber contains the country code. So, as you can see in the rules below, I have replaced the country code with "0" to check if it exists or not. But the problem is that I'm replacing the country code for only one country which is hard coded. I want it to be more generic, so I can replace all the country codes. If there is any way this is possible please let me know. And also I cannot change the database structure now.

Firebase Security Rules:

Numbers Stored in Firebase phone number Authentication:

Thanks in advance.


问:
React.useState: set function does not work
```<code>  import * as React from 'react'
  let [on, setOn] = React.useState(false)

  React.useEffect(() => {

      window.api.electronIpcSend("confsettings", "give-me-data-from-db");
      window.api.electronIpcOn("jitsiSetts-from-db", (event, args) => {
        console.log("conference.tsx-jitsiSetts-from-db-args.alwaysOnTopWindowEnable: ", args)
        let jitsiSetts = args
        console.log("conference.tsx-jitsiSetts.alwaysOnTopWindowEnable = args : ", jitsiSetts.alwaysOnTopWindowEnable)
        if (jitsiSetts.alwaysOnTopWindowEnable === 1) {
          console.log("It has to be set as TRUE")
          setOn(true)
          console.log("on: ", on)
        } else {
          console.log("It has to be set as FALSE")
          setOn(false)
          console.log("on: ", on)
        }
        console.log("on-2: ", on)
      })

    return () => { // clean-up function
    }
  }, [])
</code>```

I get this strange output:

```<code>conference.tsx-jitsiSetts.alwaysOnTopWindowEnable = args :  1
It has to be set as TRUE
on:  false
on-2:  false
</code>```

How to correctly set on with setOn to true?

Body:
  import * as React from 'react'
  let [on, setOn] = React.useState(false)

  React.useEffect(() => {

      window.api.electronIpcSend("confsettings", "give-me-data-from-db");
      window.api.electronIpcOn("jitsiSetts-from-db", (event, args) => {
        console.log("conference.tsx-jitsiSetts-from-db-args.alwaysOnTopWindowEnable: ", args)
        let jitsiSetts = args
        console.log("conference.tsx-jitsiSetts.alwaysOnTopWindowEnable = args : ", jitsiSetts.alwaysOnTopWindowEnable)
        if (jitsiSetts.alwaysOnTopWindowEnable === 1) {
          console.log("It has to be set as TRUE")
          setOn(true)
          console.log("on: ", on)
        } else {
          console.log("It has to be set as FALSE")
          setOn(false)
          console.log("on: ", on)
        }
        console.log("on-2: ", on)
      })

    return () => { // clean-up function
    }
  }, [])

I get this strange output:

conference.tsx-jitsiSetts.alwaysOnTopWindowEnable = args :  1
It has to be set as TRUE
on:  false
on-2:  false

How to correctly set on with setOn to true?


问:
Laravel 9 get all subcategories which is from same parent not working
please check i have below total 3 tables. now when i get claim records i want to get all subcategories from same category using relationships. i have stored subcategory id in my claimdata table. i want to create drop-down dynamically for all claimdata records that's why i need all subcategories from same parent category with each claimdata records

Table1 :  Category

id
Category

1
cat1

2
cat2

Table2 :  SubCategory

id
Category_id
SubCategory

3
1
subcat1

4
1
subcat2

5
2
subcat3

6
2
subcat4

Table2 :  ClaimData

id
subcategory_id
claimName

1
3
abc

2
3
def

2
5
xyz

2
6
pqr

relationship is

```<code>public function subcategories()
{
   $this->hasMany(SubCategory::class,'id','subcategory_id');
}
</code>```

my query is
$claimdata = ClaimsData::with('subcategories')->get();

currently it returns only related one subcategory but we wants all subcategory list from same parent category.

```<code>    [{
          "id" : 1,
          "subcategory_id" : 3,
          "claimName" : "abc",
          "subcategories" : [{
            "id" : 3,
            "category_id" : 1,
            "SubCategory" : "subcat1"
          }]
    },
{
  "id" : 2,
  "subcategory_id" : 3,
  "claimName" : "def",
  "subcategories" : [{
    "id" : 3,
    "category_id" : 1,
    "SubCategory" : "subcat1"
  }]
},....]
</code>```

expected output :

```<code>[{
  "id" : 1,
  "subcategory_id" : 3,
  "claimName" : "abc",
  "subcategories" : [{
    "id" : 3,
    "category_id" : 1,
    "SubCategory" : "subcat1"
  },
  {
    "id" : 4,
    "category_id" : 1,
    "SubCategory" : "subcat2"
  }]

},
{
  "id" : 2,
  "subcategory_id" : 3,
  "claimName" : "def",
  "subcategories" : [{
    "id" : 3,
    "category_id" : 1,
    "SubCategory" : "subcat1"
  },
  {
    "id" : 4,
    "category_id" : 1,
    "SubCategory" : "subcat2"
  }]

},
{
  "id" : 3,
  "subcategory_id" : 5,
  "claimName" : "def",
  "subcategories" : [{
    "id" : 5,
    "category_id" : 2,
    "SubCategory" : "subcat3"
  },
  {
    "id" : 6,
    "category_id" : 2,
    "SubCategory" : "subcat4"
  }]

},
{
  "id" : 4,
  "subcategory_id" : 6,
  "claimName" : "def",
  "subcategories" : [{
    "id" : 5,
    "category_id" : 2,
    "SubCategory" : "subcat3"
  },
  {
    "id" : 6,
    "category_id" : 2,
    "SubCategory" : "subcat4"
  }]

}]
</code>```

Body:
please check i have below total 3 tables. now when i get claim records i want to get all subcategories from same category using relationships. i have stored subcategory id in my claimdata table. i want to create drop-down dynamically for all claimdata records that's why i need all subcategories from same parent category with each claimdata records

Table1 :  Category

id
Category

1
cat1

2
cat2

Table2 :  SubCategory

id
Category_id
SubCategory

3
1
subcat1

4
1
subcat2

5
2
subcat3

6
2
subcat4

Table2 :  ClaimData

id
subcategory_id
claimName

1
3
abc

2
3
def

2
5
xyz

2
6
pqr

relationship is

public function subcategories()
{
   $this->hasMany(SubCategory::class,'id','subcategory_id');
}

my query is
$claimdata = ClaimsData::with('subcategories')->get();

currently it returns only related one subcategory but we wants all subcategory list from same parent category.

    [{
          "id" : 1,
          "subcategory_id" : 3,
          "claimName" : "abc",
          "subcategories" : [{
            "id" : 3,
            "category_id" : 1,
            "SubCategory" : "subcat1"
          }]
    },
{
  "id" : 2,
  "subcategory_id" : 3,
  "claimName" : "def",
  "subcategories" : [{
    "id" : 3,
    "category_id" : 1,
    "SubCategory" : "subcat1"
  }]
},....]

expected output :

[{
  "id" : 1,
  "subcategory_id" : 3,
  "claimName" : "abc",
  "subcategories" : [{
    "id" : 3,
    "category_id" : 1,
    "SubCategory" : "subcat1"
  },
  {
    "id" : 4,
    "category_id" : 1,
    "SubCategory" : "subcat2"
  }]

},
{
  "id" : 2,
  "subcategory_id" : 3,
  "claimName" : "def",
  "subcategories" : [{
    "id" : 3,
    "category_id" : 1,
    "SubCategory" : "subcat1"
  },
  {
    "id" : 4,
    "category_id" : 1,
    "SubCategory" : "subcat2"
  }]

},
{
  "id" : 3,
  "subcategory_id" : 5,
  "claimName" : "def",
  "subcategories" : [{
    "id" : 5,
    "category_id" : 2,
    "SubCategory" : "subcat3"
  },
  {
    "id" : 6,
    "category_id" : 2,
    "SubCategory" : "subcat4"
  }]

},
{
  "id" : 4,
  "subcategory_id" : 6,
  "claimName" : "def",
  "subcategories" : [{
    "id" : 5,
    "category_id" : 2,
    "SubCategory" : "subcat3"
  },
  {
    "id" : 6,
    "category_id" : 2,
    "SubCategory" : "subcat4"
  }]

}]


问:
How can I set Global Variables, that are not so secret?
I'm working on a NextJS website project that someone else will be working on too, when I'm done. He's pulling this project from time to time via Github, so I can show him how far I've come with our website.

I realized, that I want to set some global variables, like the links to our social media profiles, so that we could change them at one place, if something should change in the future. I did this with .env until now, but it contains secret variables as well. So I need to tell my collegue everytime I change something, how he needs to update it manually.

I tried it with setting ENVs in the next.config.js, but it won't work? I always get an undefined :(

This is my next.config.js

```<code>    const withBundleAnalyzer = require('@next/bundle-analyzer')({
        enabled: process.env.ANALYZE === 'true',
    });

    /** @type {import('next').NextConfig} */
    const path = require('path');
    const withPWA = require('next-pwa')({
        dest: 'public',
        disable: process.env.NODE_ENV === 'development',
        sw: 'sw.js'
    });
    const nextConfig = {
        reactStrictMode: true,
        swcMinify: true,
        trailingSlash: false,
        webpackDevMiddleware: config => {
            config.watchOptions = {
                poll: 1000,
                aggregateTimeout: 300
            }

        return config
        },
        sassOptions: {
            includePaths: [path.join(__dirname, 'styles')]
        },
        experimental: {
            images: {
                layoutRaw: true
            }
        },
        images: {
            /*unoptimized: true - for static export!*/
            /*deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
            formats: ['image/webp']*/
        },
        env: {
            NEXT_PUBLIC_TESTURL: "https://testurl.com"
        }
    };

    module.exports = withBundleAnalyzer(withPWA({nextConfig}));
</code>```

This is my page

```<code>export default function Page() {

console.log(process.env.NEXT_PUBLIC_TESTURL);
    return (
        <></>
    )
}
</code>```

This is something basic, right? What am I doing wrong?
I really appreciate your help!

Body:
I'm working on a NextJS website project that someone else will be working on too, when I'm done. He's pulling this project from time to time via Github, so I can show him how far I've come with our website.

I realized, that I want to set some global variables, like the links to our social media profiles, so that we could change them at one place, if something should change in the future. I did this with .env until now, but it contains secret variables as well. So I need to tell my collegue everytime I change something, how he needs to update it manually.

I tried it with setting ENVs in the next.config.js, but it won't work? I always get an undefined :(

This is my next.config.js

    const withBundleAnalyzer = require('@next/bundle-analyzer')({
        enabled: process.env.ANALYZE === 'true',
    });

    /** @type {import('next').NextConfig} */
    const path = require('path');
    const withPWA = require('next-pwa')({
        dest: 'public',
        disable: process.env.NODE_ENV === 'development',
        sw: 'sw.js'
    });
    const nextConfig = {
        reactStrictMode: true,
        swcMinify: true,
        trailingSlash: false,
        webpackDevMiddleware: config => {
            config.watchOptions = {
                poll: 1000,
                aggregateTimeout: 300
            }

        return config
        },
        sassOptions: {
            includePaths: [path.join(__dirname, 'styles')]
        },
        experimental: {
            images: {
                layoutRaw: true
            }
        },
        images: {
            /*unoptimized: true - for static export!*/
            /*deviceSizes: [640, 750, 828, 1080, 1200, 1920, 2048, 3840],
            formats: ['image/webp']*/
        },
        env: {
            NEXT_PUBLIC_TESTURL: "https://testurl.com"
        }
    };

    module.exports = withBundleAnalyzer(withPWA({nextConfig}));

This is my page

export default function Page() {

console.log(process.env.NEXT_PUBLIC_TESTURL);
    return (
        <></>
    )
}

This is something basic, right? What am I doing wrong?
I really appreciate your help!


问:
Google Maps Android Marker Clustering with markers that get their coordinates from Firebase
I want to use Google Maps Android Marker Clustering with markers that take Firestore coordinates.

MapsActivity:

```<code>public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {

    private GoogleMap mMap;
    private ActivityMapsBinding binding;
    private ClusterManager<MyClusterItem> clusterManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = ActivityMapsBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;
        setUpClusterer(mMap);

        FirebaseFirestore db = FirebaseFirestore.getInstance();

        // SET CAMERA
        mMap.setMinZoomPreference(10.0f);
        mMap.setMaxZoomPreference(20.0f);
        LatLngBounds ticinoBounds = new LatLngBounds(
                new LatLng(45.805825566907345, 8.769484272440344), // SW bounds
                new LatLng(46.16610788443759, 9.097742851389778)  // NE bounds
        );
        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(ticinoBounds.getCenter(), 10));
        mMap.setLatLngBoundsForCameraTarget(ticinoBounds);

        //INFO WINDOW

        CustomInfoWindowAdapter adapter = new CustomInfoWindowAdapter(MapsActivity.this);
        mMap.setInfoWindowAdapter(adapter);

        //MARKER
        final IconGenerator tc = new IconGenerator(this);
        tc.setTextAppearance(R.style.iconGenText); // TIPO E COLORE CARATTERI
        tc.setStyle(IconGenerator.STYLE_GREEN); // BACKGROUND

        db.collection("Places").get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {

            @Override
            public void onComplete(@NonNull Task<QuerySnapshot> task) {
                if (task.isSuccessful()) {
                    for (QueryDocumentSnapshot document : task.getResult()) {
                        if (document != null) {

                            GeoPoint geoPoint = document.getGeoPoint("geo");
                            LatLng location = new LatLng(geoPoint.getLatitude(), geoPoint.getLongitude());
                            String name = document.getString("name");
                            String descVia = document.getString("descVia");
                            String descTel = document.getString("descTel");

                            Bitmap bmp = tc.makeIcon("CHF/EUR: " + document.get("CHFEUR") + "\r\n" + "EUR/CHF: " + document.get("EURCHF"));

                            Marker marker = mMap.addMarker(new MarkerOptions()
                                    .position(location)
                                    .title(name)
                                    .snippet(descVia + "\r\n" + descTel )
                                    .icon(BitmapDescriptorFactory.fromBitmap(bmp)));
                            marker.showInfoWindow();

                        }
                    }
                } else {
                    Log.d(TAG, task.getException().getMessage()); //Never ignore potential errors!
                }
            }
        });
    }

    private void setUpClusterer(GoogleMap mMap) {

        // Initialize the manager with the context and the map.
        // (Activity extends context, so we can pass 'this' in the constructor.)
        clusterManager = new ClusterManager<MyClusterItem>(this, mMap);

        // Point the map's listeners at the listeners implemented by the cluster
        // manager.
        this.mMap.setOnCameraIdleListener(clusterManager);
        this.mMap.setOnMarkerClickListener(clusterManager);

        // Add cluster items (markers) to the cluster manager.
        addItems();
    }

    private void addItems() {

        // Set some lat/lng coordinates to start with.
        double lat = 45.97785520814739;
        double lng = 8.962509249084082;

        // Add ten cluster items in close proximity, for purposes of this example.
        for (int i = 0; i < 10; i++) {
            double offset = i / 300d;
            lat = lat + offset;
            lng = lng + offset;
            MyClusterItem offsetItem = new MyClusterItem(lat, lng, "Title " + i, "Snippet " + i);

            clusterManager.addItem(offsetItem);
        }
    }

}

</code>```

addItem is an example and it works.

MyClusterTem:

```<code>public class MyClusterItem implements ClusterItem {
    private final LatLng position;
    private final String title;
    private final String snippet;

    public MyClusterItem(double lat, double lng, String title, String snippet) {
        position = new LatLng(lat, lng);
        this.title = title;
        this.snippet = snippet;
    }

    @Override
    public LatLng getPosition() {
        return position;
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public String getSnippet() {
        return snippet;
    }
}
</code>```

I need to figure out how to integrate the same system as the example with my markers.

Thanks for help.

This is the result..

Body:
I want to use Google Maps Android Marker Clustering with markers that take Firestore coordinates.

MapsActivity:

public class MapsActivity extends FragmentActivity implements OnMapReadyCallback {

    private GoogleMap mMap;
    private ActivityMapsBinding binding;
    private ClusterManager<MyClusterItem> clusterManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = ActivityMapsBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());

        // Obtain the SupportMapFragment and get notified when the map is ready to be used.
        SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()
                .findFragmentById(R.id.map);
        mapFragment.getMapAsync(this);
    }

    @Override
    public void onMapReady(GoogleMap googleMap) {
        mMap = googleMap;
        setUpClusterer(mMap);

        FirebaseFirestore db = FirebaseFirestore.getInstance();

        // SET CAMERA
        mMap.setMinZoomPreference(10.0f);
        mMap.setMaxZoomPreference(20.0f);
        LatLngBounds ticinoBounds = new LatLngBounds(
                new LatLng(45.805825566907345, 8.769484272440344), // SW bounds
                new LatLng(46.16610788443759, 9.097742851389778)  // NE bounds
        );
        mMap.moveCamera(CameraUpdateFactory.newLatLngZoom(ticinoBounds.getCenter(), 10));
        mMap.setLatLngBoundsForCameraTarget(ticinoBounds);

        //INFO WINDOW

        CustomInfoWindowAdapter adapter = new CustomInfoWindowAdapter(MapsActivity.this);
        mMap.setInfoWindowAdapter(adapter);

        //MARKER
        final IconGenerator tc = new IconGenerator(this);
        tc.setTextAppearance(R.style.iconGenText); // TIPO E COLORE CARATTERI
        tc.setStyle(IconGenerator.STYLE_GREEN); // BACKGROUND

        db.collection("Places").get().addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {

            @Override
            public void onComplete(@NonNull Task<QuerySnapshot> task) {
                if (task.isSuccessful()) {
                    for (QueryDocumentSnapshot document : task.getResult()) {
                        if (document != null) {

                            GeoPoint geoPoint = document.getGeoPoint("geo");
                            LatLng location = new LatLng(geoPoint.getLatitude(), geoPoint.getLongitude());
                            String name = document.getString("name");
                            String descVia = document.getString("descVia");
                            String descTel = document.getString("descTel");

                            Bitmap bmp = tc.makeIcon("CHF/EUR: " + document.get("CHFEUR") + "\r\n" + "EUR/CHF: " + document.get("EURCHF"));

                            Marker marker = mMap.addMarker(new MarkerOptions()
                                    .position(location)
                                    .title(name)
                                    .snippet(descVia + "\r\n" + descTel )
                                    .icon(BitmapDescriptorFactory.fromBitmap(bmp)));
                            marker.showInfoWindow();

                        }
                    }
                } else {
                    Log.d(TAG, task.getException().getMessage()); //Never ignore potential errors!
                }
            }
        });
    }

    private void setUpClusterer(GoogleMap mMap) {

        // Initialize the manager with the context and the map.
        // (Activity extends context, so we can pass 'this' in the constructor.)
        clusterManager = new ClusterManager<MyClusterItem>(this, mMap);

        // Point the map's listeners at the listeners implemented by the cluster
        // manager.
        this.mMap.setOnCameraIdleListener(clusterManager);
        this.mMap.setOnMarkerClickListener(clusterManager);

        // Add cluster items (markers) to the cluster manager.
        addItems();
    }

    private void addItems() {

        // Set some lat/lng coordinates to start with.
        double lat = 45.97785520814739;
        double lng = 8.962509249084082;

        // Add ten cluster items in close proximity, for purposes of this example.
        for (int i = 0; i < 10; i++) {
            double offset = i / 300d;
            lat = lat + offset;
            lng = lng + offset;
            MyClusterItem offsetItem = new MyClusterItem(lat, lng, "Title " + i, "Snippet " + i);

            clusterManager.addItem(offsetItem);
        }
    }

}

addItem is an example and it works.

MyClusterTem:

public class MyClusterItem implements ClusterItem {
    private final LatLng position;
    private final String title;
    private final String snippet;

    public MyClusterItem(double lat, double lng, String title, String snippet) {
        position = new LatLng(lat, lng);
        this.title = title;
        this.snippet = snippet;
    }

    @Override
    public LatLng getPosition() {
        return position;
    }

    @Override
    public String getTitle() {
        return title;
    }

    @Override
    public String getSnippet() {
        return snippet;
    }
}

I need to figure out how to integrate the same system as the example with my markers.

Thanks for help.

This is the result..


问:
FileNotFoundError for a json file on hdfs location when running oozie
I am trying to pass a dictionary of arguments to a script (a spark action) in an oozie.
The dictionary is in a .json file.
I pass the .json file as an argument in workflow.xml  but deploying the coordinator of my oozie I get the file not found error (as below)

I can see the file in the hdfs location though

This is how I am including the .json file in the argument in my workflow.xml