问:
Quarkus reactive client - sending Multipart from ByteArray
Im trying to use io.quarkus:quarkus-rest-client-reactive-jackson to send a multipart file.

Here is my client class

```<code>@RegisterRestClient(configKey = "foo")
interface FooClient {
    @POST
    @Path("/upload")
    fun uploadFile(
        @RestForm("file")
        @PartType("application/octet-stream")
        file: ByteArray
    ): Uni<String>
}
</code>```

and here is how I invoke it

```<code>val file:ByteArray = storage.readAllBytes("foo", "foo")
fooClient.uploadFile(file = file)
              .subscribe()
              .with { log.info("upload file result : $it") }
</code>```

but I always get internal server error

2022-12-24 03:11:55,135 ERROR [io.qua.mut.run.MutinyInfrastructure]
(vert.x-eventloop-thread-0) Mutiny had to drop the following
exception: org.jboss.resteasy.reactive.ClientWebApplicationException:
Received: 'Internal Server Error, status code 500' when invoking: Rest
Client method: 'foo.FooClient#uploadFile'

How to send a multipart file with ByteArray in quarkus reactive?

Body:
Im trying to use io.quarkus:quarkus-rest-client-reactive-jackson to send a multipart file.

Here is my client class

@RegisterRestClient(configKey = "foo")
interface FooClient {
    @POST
    @Path("/upload")
    fun uploadFile(
        @RestForm("file")
        @PartType("application/octet-stream")
        file: ByteArray
    ): Uni<String>
}

and here is how I invoke it

val file:ByteArray = storage.readAllBytes("foo", "foo")
fooClient.uploadFile(file = file)
              .subscribe()
              .with { log.info("upload file result : $it") }

but I always get internal server error

2022-12-24 03:11:55,135 ERROR [io.qua.mut.run.MutinyInfrastructure]
(vert.x-eventloop-thread-0) Mutiny had to drop the following
exception: org.jboss.resteasy.reactive.ClientWebApplicationException:
Received: 'Internal Server Error, status code 500' when invoking: Rest
Client method: 'foo.FooClient#uploadFile'

How to send a multipart file with ByteArray in quarkus reactive?


来源: stackexchange

问:
Google Calendar - Find Another User's Timezone
Is it possible using the Google APIs to retrieve the timezone for another user?

For example, using the Python Client Library, it's possible to get a user's timezone with something simple like the below...

```<code>#build calendar service_calendar
service_calendar = build('calendar', 'v3', credentials=credentials)

# Get the user's timezone
timezone = service_calendar.settings().get(setting='timezone').execute()
</code>```

...but this can only be used to retrieve the timezone for the credentialed user.

If I'm in a same-domain organization where things like calendar free/busy are shared, is it possible to determine the timezone of another user (whose credentials I don't have) by calling something similar?

ContentLicense: CC BY-SA 4.0

Body:
Is it possible using the Google APIs to retrieve the timezone for another user?

For example, using the Python Client Library, it's possible to get a user's timezone with something simple like the below...

#build calendar service_calendar
service_calendar = build('calendar', 'v3', credentials=credentials)

# Get the user's timezone
timezone = service_calendar.settings().get(setting='timezone').execute()

...but this can only be used to retrieve the timezone for the credentialed user.

If I'm in a same-domain organization where things like calendar free/busy are shared, is it possible to determine the timezone of another user (whose credentials I don't have) by calling something similar?


问:
Trying to automate LinkedIn Connect on a profile page but Error "ElementNotInteractableException: element not interactable"
I have the linkedin profile urls, but i want to automate clicking the connect button and sending invite. But i keep getting element not interactable error. Please help! Thanks!

page source ->

```<code>
<button aria-label="Invite Salwa Salim to connect" id="ember71" class="artdeco-button artdeco-button--2 artdeco-button--primary ember-view" type="button">  <li-icon aria-hidden="true" type="connect" class="artdeco-button__icon" size="small"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" data-supported-dps="16x16" fill="currentColor" class="mercado-match" width="16" height="16" focusable="false">
  <path d="M9 4a3 3 0 11-3-3 3 3 0 013 3zM6.75 8h-1.5A2.25 2.25 0 003 10.25V15h6v-4.75A2.25 2.25 0 006.75 8zM13 8V6h-1v2h-2v1h2v2h1V9h2V8z"></path>
</svg></li-icon>

<span class="artdeco-button__text">
    Connect
</span></button>
</code>```

my code ->

```<code>x = WebDriverWait(browser,100).until(EC.element_to_be_clickable((By.XPATH,"//*[@class='artdeco-button artdeco-button--2 artdeco-button--primary ember-view']")))
print(x)
x.click()
</code>```

i have tried ->

Other ways of locating - aria label, classname etc. All return the same error.

```<code>ElementNotInteractableException: element not interactable
  (Session info: MicrosoftEdge=108.0.1462.54)
</code>```

and... wait til element_to_be_clickable and presence_of_element_located ->

```<code>    raise TimeoutException(message, screen, stacktrace)

TimeoutException
</code>```

Body:
I have the linkedin profile urls, but i want to automate clicking the connect button and sending invite. But i keep getting element not interactable error. Please help! Thanks!

page source ->

<button aria-label="Invite Salwa Salim to connect" id="ember71" class="artdeco-button artdeco-button--2 artdeco-button--primary ember-view" type="button">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" data-supported-dps="16x16" fill="currentColor" class="mercado-match" width="16" height="16" focusable="false">
  <path d="M9 4a3 3 0 11-3-3 3 3 0 013 3zM6.75 8h-1.5A2.25 2.25 0 003 10.25V15h6v-4.75A2.25 2.25 0 006.75 8zM13 8V6h-1v2h-2v1h2v2h1V9h2V8z"></path>
</svg>

    Connect
</button>

my code ->

x = WebDriverWait(browser,100).until(EC.element_to_be_clickable((By.XPATH,"//*[@class='artdeco-button artdeco-button--2 artdeco-button--primary ember-view']")))
print(x)
x.click()

i have tried ->

Other ways of locating - aria label, classname etc. All return the same error.

ElementNotInteractableException: element not interactable
  (Session info: MicrosoftEdge=108.0.1462.54)

and... wait til element_to_be_clickable and presence_of_element_located ->

    raise TimeoutException(message, screen, stacktrace)

TimeoutException


问:
How to access report/dashboard/app that is shared with me (by the provider via azure b2b) in power bi mobile app?
A provider has added me to their Azure AD (B2B) as a guest user and some reports/dashboards/apps have been shared with me. I can access them in the web browser using the link that has come in the email.

I open the link in web browser and login using my own credentials, and can view the report/dashboard/app.

This question is to ask - how do I view the above via the Power BI mobile app?


问:
KeyError: 'primaryName' with csv.DictReader
first time poster - long time lurker.

I'm a little rough around the edges when it comes to Python and I'm running into an issue that I imagine has an easy fix.

I have a CSV file that I'm looking to read and perform a semi-advanced lookup.

The CSV in question is not really comma delimited when inspecting it in VS Code except the last "column".

Example (direct format screenshot from the file):

screenshot

The line that seems to have issues is:

```<code>import csv
import sys
from util import Node, StackFrontier, QueueFrontier

names = {}

people = {}

titles = {}

def load_data(directory):

    with open(f"{directory}/file.csv", encoding="utf-8") as f:
        reader = csv.DictReader(f)
        for row in reader:
            people[row["id"]] = {
                "primaryName": row["primaryName"],
                "birthYear": row["birthYear"],
                "titles": set()
            }
            if row["primaryName"].lower() not in names:
                names[row["primaryName"].lower()] = {row["nconst"]}
            else:
                names[row["primaryName"].lower()].add(row["nconst"])
</code>```

The error I receive is:

```<code>  File "C:\GitHub\Project\data-test.py", line 24, in load_data
    "primaryName": row["primaryName"],
                   ~~~^^^^^^^^^^^^^^^
KeyError: 'primaryName'
</code>```

I've tried this with other CSV files where they are comma delimited, (screenshot example below):

screenshot

And that works perfectly fine. I noticed the above CSV file has the names in ""s which I imagine could be part of the solution.

Ultimately, if I can get it to work with the code above that would be great - otherwise, is there an easy way to automatically format the CSV file to put quotations around the names and separate the value by commas like the csv that's working above?

Thanks in advance for any help.

Body:
first time poster - long time lurker.

I'm a little rough around the edges when it comes to Python and I'm running into an issue that I imagine has an easy fix.

I have a CSV file that I'm looking to read and perform a semi-advanced lookup.

The CSV in question is not really comma delimited when inspecting it in VS Code except the last "column".

Example (direct format screenshot from the file):

screenshot

The line that seems to have issues is:

import csv
import sys
from util import Node, StackFrontier, QueueFrontier

names = {}

people = {}

titles = {}

def load_data(directory):

    with open(f"{directory}/file.csv", encoding="utf-8") as f:
        reader = csv.DictReader(f)
        for row in reader:
            people[row["id"]] = {
                "primaryName": row["primaryName"],
                "birthYear": row["birthYear"],
                "titles": set()
            }
            if row["primaryName"].lower() not in names:
                names[row["primaryName"].lower()] = {row["nconst"]}
            else:
                names[row["primaryName"].lower()].add(row["nconst"])

The error I receive is:

  File "C:\GitHub\Project\data-test.py", line 24, in load_data
    "primaryName": row["primaryName"],
                   ~~~^^^^^^^^^^^^^^^
KeyError: 'primaryName'

I've tried this with other CSV files where they are comma delimited, (screenshot example below):

screenshot

And that works perfectly fine. I noticed the above CSV file has the names in ""s which I imagine could be part of the solution.

Ultimately, if I can get it to work with the code above that would be great - otherwise, is there an easy way to automatically format the CSV file to put quotations around the names and separate the value by commas like the csv that's working above?

Thanks in advance for any help.


问:
AttributeError: module 'wsgi' has no attribute 'application'
I am trying to run a python script from php code in cpanel. I have created a python app in my cpanel with version 3.7.12, whenever I am trying to run the app it is giving below log error

```<code>Traceback (most recent call last):
File "/home/mesuivln/seopython/passenger_wsgi.py", line 7, in <module>
application = wsgi.application
AttributeError: module 'wsgi' has no attribute 'application'
</code>```

Below is the code in passenger_wsgi.py file which is automatically generated by cpanel

```<code>import imp
import os
import sys

wsgi = imp.load_source('wsgi', 'h1parser.py')
application = wsgi.application
</code>```

and below is the code in my h1parser.py file

```<code>#!/usr/bin/env python

import requests
from readability import Document
import yake
from bs4 import BeautifulSoup
from urllib.parse import urlparse
from collections import Counter
import re
import sys
import mysql.connector
import html

print('oksssss')
</code>```

Note that whole thing works when I run from the cpanel terminal using below commands

```<code>source /home/mesuivln/virtualenv/pythonseo/3.7/bin/activate && cd /home/mesuivln/pythonseo
python h1parser.py
</code>```

but giving error when trying to run from the python app or from below php code

```<code>$command=escapeshellcmd('python /home/mesuivln/pythonseo/h1parser.py');
$output = shell_exec($command);
echo $output;
</code>```

how to solve this?

Body:
I am trying to run a python script from php code in cpanel. I have created a python app in my cpanel with version 3.7.12, whenever I am trying to run the app it is giving below log error

Traceback (most recent call last):
File "/home/mesuivln/seopython/passenger_wsgi.py", line 7, in <module>
application = wsgi.application
AttributeError: module 'wsgi' has no attribute 'application'

Below is the code in passenger_wsgi.py file which is automatically generated by cpanel

import imp
import os
import sys

wsgi = imp.load_source('wsgi', 'h1parser.py')
application = wsgi.application

and below is the code in my h1parser.py file

#!/usr/bin/env python

import requests
from readability import Document
import yake
from bs4 import BeautifulSoup
from urllib.parse import urlparse
from collections import Counter
import re
import sys
import mysql.connector
import html

print('oksssss')

Note that whole thing works when I run from the cpanel terminal using below commands

source /home/mesuivln/virtualenv/pythonseo/3.7/bin/activate && cd /home/mesuivln/pythonseo
python h1parser.py

but giving error when trying to run from the python app or from below php code

$command=escapeshellcmd('python /home/mesuivln/pythonseo/h1parser.py');
$output = shell_exec($command);
echo $output;

how to solve this?


问:
Need help fixing this Error message in R "Error in cbind(yval2, yprob, nodeprob) : number of rows of matrices must match (see arg 2)"
I am trying boosting and bagging methods in R using the penguins data in the palmerpenguins package but keep getting this error message while trying to do the bagging method.
This is my code below

```<code>penguins.bagging <- bagging(formula = species ~ ., data =penguins[train,], mfinal =8,
                        control=rpart.control(maxdepth = 1))
</code>```

This is the error code I get after running this line

Error in cbind(yval2, yprob, nodeprob) :    number of rows of matrices
must match (see arg 2)

I have tried changing the mfinal number to 344, 333 (both numbers represent number of rows in the file first one with NA's, 2nd number without NA's) I have also tried using smaller numbers like 10 and 5.

Body:
I am trying boosting and bagging methods in R using the penguins data in the palmerpenguins package but keep getting this error message while trying to do the bagging method.
This is my code below

penguins.bagging <- bagging(formula = species ~ ., data =penguins[train,], mfinal =8,
                        control=rpart.control(maxdepth = 1))

This is the error code I get after running this line

Error in cbind(yval2, yprob, nodeprob) :    number of rows of matrices
must match (see arg 2)

I have tried changing the mfinal number to 344, 333 (both numbers represent number of rows in the file first one with NA's, 2nd number without NA's) I have also tried using smaller numbers like 10 and 5.


问:
Passing data parameters on SSRS using snowflake datasoruce
We are migrating the SSRS reports to Snowflake,

My SQL has data in parameters, like the following query:

```<code>Select * From tbname Where xtype In (xtype)
</code>```

How can I recreate this query in Snowflake?

Body:
We are migrating the SSRS reports to Snowflake,

My SQL has data in parameters, like the following query:

Select * From tbname Where xtype In (xtype)

How can I recreate this query in Snowflake?


问:
How to display a view at the exact location of an image in Android?
I want to make the phone's wallpaper in an imageview and position the view at a specific location above it

The problem is that each phone has a different resolution, so the ratio of the wallpaper is different.

Is there any way to position the view in the same location on the wallpaper on all devices?

I am trying as below thank you

```<code> <FrameLayout
        android:id="@+id/ll_map_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <ImageView
            android:scaleType="fitCenter"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@drawable/bg"/>
</code>```
```<code>ImageView img = new ImageView(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(20,20);
img.setLayoutParams(params);
img.setImageResource(R.drawable.target);
img.setX(200);
img.setY(200);
llMapMain.addView(img);
</code>```

Body:
I want to make the phone's wallpaper in an imageview and position the view at a specific location above it

The problem is that each phone has a different resolution, so the ratio of the wallpaper is different.

Is there any way to position the view in the same location on the wallpaper on all devices?

I am trying as below thank you

 <FrameLayout
        android:id="@+id/ll_map_main"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical">

        <ImageView
            android:scaleType="fitCenter"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:src="@drawable/bg"/>

ImageView img = new ImageView(getContext());
LinearLayout.LayoutParams params = new LinearLayout.LayoutParams(20,20);
img.setLayoutParams(params);
img.setImageResource(R.drawable.target);
img.setX(200);
img.setY(200);
llMapMain.addView(img);


问:
(Next.js) Passing state object from an array mapping to router query when rerouting. TypeError: Cannot read properties of undefined (reading 'name')
How do I pass each coin being mapped through to state so when routed to the CoinInfo.jsx page I can pass 'coin' as a prop when calling sendProps in CoinSearch.jsx. So I can have access to the the coin's attributes on the CoinInfo page and can provide data to the user relating to the 'coin' being mapped through in CoinSearch.jsx

Full Error.
Github Rep: https://github.com/masonrs2/crypto-coin-search

CoinSearch.jsx

```<code>import React, { useEffect, useState } from 'react'
import { AiOutlineStar, AiFillStar } from 'react-icons/ai'
import { Sparklines, SparklinesLine } from 'react-sparklines';
import Router from 'next/router'
import Link from 'next/link'
import Signup from '../pages/Pages/Signup'

import Image from 'next/image'

const CoinSearch = () => {
    const [coins, setCoins] = useState([])
    const [coin, setCoin] = useState({})
    const [name, setName] = useState("Name..")
    const [search, setSearch] = useState("")
    const [savedCoin, setSavedCoin] = useState(false)

    function sendProps() {
        console.log('coin: ', coin)
        Router.push({
            pathname: "/Pages/CoinInfo",
            query: {
                name,
                coin
            }
        })
    }

    const saveCoin = async () => {
        if (user?.email) {
          setSavedCoin(true);
          await updateDoc(coinPath, {
            watchList: arrayUnion({
              id: coin.id,
              name: coin.name,
              image: coin.image,
              rank: coin.market_cap_rank,
              symbol: coin.symbol,
            }),
          });
        } else {
          alert('Please sign in to save a coin to your watch list');
        }
      };

    const coinGeckoUrl = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=100&page=1&sparkline=true&price_change_percentage=1h%2C%2024h%2C%207d'

    const fetchCoins = async () => {
        const data = await fetch(coinGeckoUrl)
        const coins = await data.json()
        setCoins(coins)
    }

    useEffect(() => {
        fetchCoins()
    }, [coinGeckoUrl])

  return (
    <div className="bg-white rounded-lg shadow-lg xl:px-32 lg:px-16 border py-10 ">
        <div className="flex flex-col border border-gray-500/20 rounded-lg">
            <h2 className="text-center font-semibold text-2xl py-2" >Search Crypto</h2>

            <div className="px-4 py-2">
                <input
                onChange={(e) => setSearch(e.target.value)}
                type="text"
                placeholder="Search a Coin"
                className="bg-gray-100 rounded-lg px-4 w-full shadow-lg py-2 text-lg border border-gray-300 outline-none"
                />
            </div>

            <div className="py-4 mx-4">
                <table className="w-full border-collapse text-center ">
                <thead className="">
                    <tr className='border-b'>
                        <th></th>
                        <th className='px-4'>#</th>
                        <th className='text-left'>Coin</th>
                        <th></th>
                        <th>Price</th>
                        <th>24h</th>
                        <th className='hidden md:table-cell'>24h Volume</th>
                        <th className='hidden sm:table-cell'>Mkt</th>
                        <th>Last 7 Days</th>
                    </tr>
                </thead>
                    <tbody className="">
                        {
                            coins.filter((coin) => {
                                if(search === ""){
                                    return coin
                                }
                                else {
                                    return coin.name.toLowerCase().includes(search.toLowerCase())
                                }

                            }).map((coin, id) => (
                                <tr className='h-[80px] border-b overflow-hidden hover:scale-95 duration-300 cursor-pointer '>
                                <td onClick={saveCoin}>
                                    {savedCoin ? <AiFillStar size={18} /> : <AiOutlineStar size={18} />}
                                </td>
                                <td>{coin.market_cap_rank}</td>
                                <td>

                                    <div onClick={() => {
                                        setCoin(coin)
                                        sendProps()
                                        }} className='flex items-center'>
                                        <div>
                                            <img
                                            onClick={() => setSavedCoin(!savedCoin)}
                                            className='w-6 mr-2 rounded-full'
                                            src={coin.image}
                                            alt={coin.id}
                                            />

                                        </div>
                                        <p className='hidden sm:table-cell'>{coin.name} <span className="text-gray-500 px-1 uppercase">{coin.symbol}</span></p>
                                    </div>

                                </td>
                                <td></td>
                                <td>${coin.current_price.toLocaleString()}</td>
                                <td>
                                    {coin.price_change_percentage_24h > 0 ? (
                                    <p className='text-green-600'>
                                        {coin.price_change_percentage_24h.toFixed(2)}%
                                    </p>
                                    ) : (
                                    <p className='text-red-600'>
                                        {coin.price_change_percentage_24h.toFixed(2)}%
                                    </p>
                                    )}
                                </td>
                                <td className='w-[180px] hidden md:table-cell'>
                                    ${coin.total_volume.toLocaleString()}
                                </td>
                                <td className='w-[180px] hidden sm:table-cell'>
                                    ${coin.market_cap.toLocaleString()}
                                </td>
                                <td>
                                   <Sparklines data={coin.sparkline_in_7d.price}>
                                    {
                                    coin.sparkline_in_7d.price[0] > coin.sparkline_in_7d.price[coin.sparkline_in_7d.price.length-1]
                                    ?
                                    <SparklinesLine color='red' />
                                    :
                                    <SparklinesLine color='teal' />
                                    }

                                   </Sparklines>

                                </td>
                                </tr>
                                ))
                            }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
  )
}

export default CoinSearch
</code>```

CoinInfo.jsx

```<code>import React, { useEffect } from 'react'
import Footer from '../../components/Footer'
import Navbar from '../../components/Navbar'
import { Sparklines, SparklinesLine } from 'react-sparklines';
import { useRouter } from 'next/router'

const CoinInfo = () => {
  const router = useRouter()

  const {
    query: { name, coin },
  } = router

  const props = {
     name,
     coin,
    };

  return (

    <div className="w-full h-screen text-black bg-stone-200 px-6">
        <Navbar />
        <div className="bg-white rounded-lg shadow-lg xl:px-32 lg:px-16 border mt-8 px-6 pt-6 pb-10">

            <h1>{props.name}</h1>
            <h1>{props.coin.name}</h1>

        </div>

        <Footer />
    </div>
  )
}

export default CoinInfo
</code>```

index.js

```<code>import { Inter } from '@next/font/google'
import styles from '../styles/Home.module.css'
import Navbar from '../components/Navbar'
import CoinSearch from '../components/CoinSearch'
import Trending from '../components/Trending'
import AboutUs from '../components/AboutUs'
import Footer from '../components/Footer'
import { AuthContextProvider } from '../context/AuthContext'
import Signup from './Pages/Signup'

const inter = Inter({ subsets: ['latin'] })

export default function Home() {
  return (
    <div className="w-full h-full text-black bg-stone-200 px-6">
        <AuthContextProvider >
            <Navbar />
            <CoinSearch />
            <Trending />
            <AboutUs />
            <Footer />
        </AuthContextProvider>
    </div>
  )
}

</code>```

File Structure

Body:
How do I pass each coin being mapped through to state so when routed to the CoinInfo.jsx page I can pass 'coin' as a prop when calling sendProps in CoinSearch.jsx. So I can have access to the the coin's attributes on the CoinInfo page and can provide data to the user relating to the 'coin' being mapped through in CoinSearch.jsx

Full Error.
Github Rep: https://github.com/masonrs2/crypto-coin-search

CoinSearch.jsx

import React, { useEffect, useState } from 'react'
import { AiOutlineStar, AiFillStar } from 'react-icons/ai'
import { Sparklines, SparklinesLine } from 'react-sparklines';
import Router from 'next/router'
import Link from 'next/link'
import Signup from '../pages/Pages/Signup'

import Image from 'next/image'

const CoinSearch = () => {
    const [coins, setCoins] = useState([])
    const [coin, setCoin] = useState({})
    const [name, setName] = useState("Name..")
    const [search, setSearch] = useState("")
    const [savedCoin, setSavedCoin] = useState(false)

    function sendProps() {
        console.log('coin: ', coin)
        Router.push({
            pathname: "/Pages/CoinInfo",
            query: {
                name,
                coin
            }
        })
    }

    const saveCoin = async () => {
        if (user?.email) {
          setSavedCoin(true);
          await updateDoc(coinPath, {
            watchList: arrayUnion({
              id: coin.id,
              name: coin.name,
              image: coin.image,
              rank: coin.market_cap_rank,
              symbol: coin.symbol,
            }),
          });
        } else {
          alert('Please sign in to save a coin to your watch list');
        }
      };

    const coinGeckoUrl = 'https://api.coingecko.com/api/v3/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=100&page=1&sparkline=true&price_change_percentage=1h%2C%2024h%2C%207d'

    const fetchCoins = async () => {
        const data = await fetch(coinGeckoUrl)
        const coins = await data.json()
        setCoins(coins)
    }

    useEffect(() => {
        fetchCoins()
    }, [coinGeckoUrl])

  return (

Search Crypto

                <input
                onChange={(e) => setSearch(e.target.value)}
                type="text"
                placeholder="Search a Coin"
                className="bg-gray-100 rounded-lg px-4 w-full shadow-lg py-2 text-lg border border-gray-300 outline-none"
                />

                        #
                        Coin

                        Price
                        24h
                        24h Volume
                        Mkt
                        Last 7 Days

                        {
                            coins.filter((coin) => {
                                if(search === ""){
                                    return coin
                                }
                                else {
                                    return coin.name.toLowerCase().includes(search.toLowerCase())
                                }

                            }).map((coin, id) => (

                                    {savedCoin ? <AiFillStar size={18} /> : <AiOutlineStar size={18} />}

                                {coin.market_cap_rank}

 {
                                        setCoin(coin)
                                        sendProps()
                                        }} className='flex items-center'>

                                             setSavedCoin(!savedCoin)}
                                            className='w-6 mr-2 rounded-full'
                                            src={coin.image}
                                            alt={coin.id}
                                            />

{coin.name} {coin.symbol}

                                ${coin.current_price.toLocaleString()}

                                    {coin.price_change_percentage_24h > 0 ? (

                                        {coin.price_change_percentage_24h.toFixed(2)}%

                                    ) : (

                                        {coin.price_change_percentage_24h.toFixed(2)}%

                                    )}

                                    ${coin.total_volume.toLocaleString()}

                                    ${coin.market_cap.toLocaleString()}

                                   <Sparklines data={coin.sparkline_in_7d.price}>
                                    {
                                    coin.sparkline_in_7d.price[0] > coin.sparkline_in_7d.price[coin.sparkline_in_7d.price.length-1]
                                    ?
                                    <SparklinesLine color='red' />
                                    :
                                    <SparklinesLine color='teal' />
                                    }

                                   </Sparklines>

                                ))
                            }

  )
}

export default CoinSearch

CoinInfo.jsx

import React, { useEffect } from 'react'
import Footer from '../../components/Footer'
import Navbar from '../../components/Navbar'
import { Sparklines, SparklinesLine } from 'react-sparklines';
import { useRouter } from 'next/router'

const CoinInfo = () => {
  const router = useRouter()

  const {
    query: { name, coin },
  } = router

  const props = {
     name,
     coin,
    };

  return (

        <Navbar />

{props.name}

{props.coin.name}

  )
}

export default CoinInfo

index.js

import { Inter } from '@next/font/google'
import styles from '../styles/Home.module.css'
import Navbar from '../components/Navbar'
import CoinSearch from '../components/CoinSearch'
import Trending from '../components/Trending'
import AboutUs from '../components/AboutUs'
import Footer from '../components/Footer'
import { AuthContextProvider } from '../context/AuthContext'
import Signup from './Pages/Signup'

const inter = Inter({ subsets: ['latin'] })

export default function Home() {
  return (

        <AuthContextProvider >
            <Navbar />
            <CoinSearch />
            <Trending />
            <AboutUs />

        </AuthContextProvider>

  )
}

File Structure


问:
How to add an item to an array within an Antlr Context in C#
I'm trying to generate LaTex for PGFPlots graphs using Antlr from a C# project.

So far, I've created this grammar for the axis, which is essentially a set of kvps:

```<code>grammar PgfPlots;

axis
    : 'axis' '[' keyValPairs ']'
    ;

keyValPairs
    : (keyValPair)+
    ;

keyValPair
    : Key '=' Value
    ;

Key
    : [a-zA-Z_][a-zA-Z_0-9]*
    ;

Value
    : INT
    | FLOAT
    | STRING
    ;

INT
    : [0-9]+
    ;

FLOAT
    : [0-9]+ '.' [0-9]+
    ;

STRING
    : '"' .*? '"'
    ;

WS
    : [ \t\r\n]+ -> skip
    ;
</code>```

However, I can't for the life of me work out how to actually populate the AST.

So far, I've tried this:

```<code>    public string GenerateSourceCode(PgfPlotDefinition plotDefinition)
    {
        PgfPlotsParser.AxisContext axis = new(null, 0);

        List<KeyValuePair<string, object>> notNullProperties = GetNotNullProperties(plotDefinition.AxisDefinition);

        for (int i = 0; i < notNullProperties.Count; i++)
        {
            KeyValuePair<string, object> kvp = notNullProperties[i];
            axis.keyValPairs().keyValPair().SetValue($"{kvp.Key} = {kvp.Value}", i);
        }

        return axis.GetText();
    }
</code>```

However, this gives me a null reference exception on the line where I'm trying to assign the kvp to the array, which I guess makes sense, because I've not created it to set the value... I just have no idea how I'm actually meant to do that bit?

Body:
I'm trying to generate LaTex for PGFPlots graphs using Antlr from a C# project.

So far, I've created this grammar for the axis, which is essentially a set of kvps:

grammar PgfPlots;

axis
    : 'axis' '[' keyValPairs ']'
    ;

keyValPairs
    : (keyValPair)+
    ;

keyValPair
    : Key '=' Value
    ;

Key
    : [a-zA-Z_][a-zA-Z_0-9]*
    ;

Value
    : INT
    | FLOAT
    | STRING
    ;

INT
    : [0-9]+
    ;

FLOAT
    : [0-9]+ '.' [0-9]+
    ;

STRING
    : '"' .*? '"'
    ;

WS
    : [ \t\r\n]+ -> skip
    ;

However, I can't for the life of me work out how to actually populate the AST.

So far, I've tried this:

    public string GenerateSourceCode(PgfPlotDefinition plotDefinition)
    {
        PgfPlotsParser.AxisContext axis = new(null, 0);

        List<KeyValuePair<string, object>> notNullProperties = GetNotNullProperties(plotDefinition.AxisDefinition);

        for (int i = 0; i < notNullProperties.Count; i++)
        {
            KeyValuePair<string, object> kvp = notNullProperties[i];
            axis.keyValPairs().keyValPair().SetValue($"{kvp.Key} = {kvp.Value}", i);
        }

        return axis.GetText();
    }

However, this gives me a null reference exception on the line where I'm trying to assign the kvp to the array, which I guess makes sense, because I've not created it to set the value... I just have no idea how I'm actually meant to do that bit?


问:
Match queries that fit change snapshot
How can one store queries (like match from mongo, or a SQL where clause), and given a change snapshot of a single document (a delta of a single row/document) lookup which queries COULD match that change?

Example:
I have a simple query: db.collection.find({name: "Ivan", status: "active"}) that gets stored as a json in the DB.
And a change occurs in the database, looking like: {type: "update", $set: {name: "Ivan"}}

I need to query a queries collection/table and find witch ones could have been impacted.

Limitations:

There could be millions of queries stored, requiring a good index approach.

The match could be limited to a few operands for simplicity (like $in, $eq, $ne)

Mongodb change streams don't scale to millions, and Postgres LISTEN/NOTIFY doesn't as well.

Is there a pattern here that I'm missing?

Title: Match queries that fit change snapshot


问:
Keras model predicting the same values from canvas image (Image Recognition)
I'm very new to machine learning and I trained a simple Keras neural network to identify handwritten digits using the MNIST dataset.

Here is what the model looks like:

```<code>model = keras.Sequential([
    keras.layers.Flatten(input_shape=(28,28)),
    keras.layers.Dense(100,activation="relu"),
    keras.layers.Dense(10,activation='sigmoid')
])

model.compile(
    optimizer='adam',
    loss = 'sparse_categorical_crossentropy',
    metrics=['accuracy']
)

model.fit(x_train,y_train,epochs=8)
</code>```

Now I made a React Application where a user draws on a canvas and presses a submit button where the model then makes a prediction. I imported my model using Tensorflow.js and when the model makes a prediction, no matter what I draw on the canvas, it outputs the same result.

Here is the App.js:

```<code>
import React, { useRef, useEffect } from 'react'
import * as tf from '@tensorflow/tfjs';

async function generatePrediction(image) {
  let prediction = 0;
  const model = await tf.loadLayersModel('/model.json');
  let step1 = tf.browser.fromPixels(image)
    .resizeNearestNeighbor([28, 28]).mean(2).toFloat().expandDims(0).div(255.0)

  prediction = model.predict(step1);
  let digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
  prediction.data()
    .then((data) => {
      console.log(data);
      let max_val = -1
      let max_val_index = -1
      for (let i = 0; i < data.length; i++) {

        if (data[i] > max_val) {
          max_val = data[i]
          max_val_index = i
        }
      }
      var result = digits[max_val_index];
      console.log(result);
    })
}

const Canvas = props => {
  const canvasRef = useRef(null)
  var image = new Image();
  useEffect(() => {
    const canvas = canvasRef.current
    const ctx = canvas.getContext('2d')
    ctx.strokeRect(0, 0, canvas.width, canvas.height);
    //Our first draw

    let isDrawing = false; //Check if drawing

    //If drawing then make a line from the beginning to the mouse.
    const drawing = (e) => {
      if (!isDrawing) {
        return;
      }

      ctx.lineTo(e.offsetX, e.offsetY);
      ctx.stroke();
      ctx.lineWidth = 10;
    }

    //Mouse down start draw
    const startDraw = () => {
      isDrawing = true;
      ctx.beginPath();
    }

    //Set drawing back to false when done drawing
    const stopDraw = () => {
      isDrawing = false;
    }
    ///Mouse Event listeners
    canvas.addEventListener("mousemove", drawing);
    canvas.addEventListener("mouseup", stopDraw);
    canvas.addEventListener("mousedown", startDraw);

    setInterval(function () {
      image.src = canvas.toDataURL()
    }, 100);
  }, [])

  function makePrediction() {
    generatePrediction(image);
  }

  return (
    <div>
      <canvas id="myCanvas" width="280" height="280" ref={canvasRef} {...props} />
      <h1> The Guessed Number Is: </h1>
      <button onClick={makePrediction}>Submit</button>
    </div>
  )
}

export default Canvas

</code>```

And this is the result:
Prediction Results

Even if I redraw a new number and press submit to predict, it shows the same values.

Prediction values exactly the same given a new number

Is there any reason why this happens?

I suspect it's the image I pass in and if it's formatted correctly.

Body:
I'm very new to machine learning and I trained a simple Keras neural network to identify handwritten digits using the MNIST dataset.

Here is what the model looks like:

model = keras.Sequential([
    keras.layers.Flatten(input_shape=(28,28)),
    keras.layers.Dense(100,activation="relu"),
    keras.layers.Dense(10,activation='sigmoid')
])

model.compile(
    optimizer='adam',
    loss = 'sparse_categorical_crossentropy',
    metrics=['accuracy']
)

model.fit(x_train,y_train,epochs=8)

Now I made a React Application where a user draws on a canvas and presses a submit button where the model then makes a prediction. I imported my model using Tensorflow.js and when the model makes a prediction, no matter what I draw on the canvas, it outputs the same result.

Here is the App.js:

import React, { useRef, useEffect } from 'react'
import * as tf from '@tensorflow/tfjs';

async function generatePrediction(image) {
  let prediction = 0;
  const model = await tf.loadLayersModel('/model.json');
  let step1 = tf.browser.fromPixels(image)
    .resizeNearestNeighbor([28, 28]).mean(2).toFloat().expandDims(0).div(255.0)

  prediction = model.predict(step1);
  let digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
  prediction.data()
    .then((data) => {
      console.log(data);
      let max_val = -1
      let max_val_index = -1
      for (let i = 0; i < data.length; i++) {

        if (data[i] > max_val) {
          max_val = data[i]
          max_val_index = i
        }
      }
      var result = digits[max_val_index];
      console.log(result);
    })
}

const Canvas = props => {
  const canvasRef = useRef(null)
  var image = new Image();
  useEffect(() => {
    const canvas = canvasRef.current
    const ctx = canvas.getContext('2d')
    ctx.strokeRect(0, 0, canvas.width, canvas.height);
    //Our first draw

    let isDrawing = false; //Check if drawing

    //If drawing then make a line from the beginning to the mouse.
    const drawing = (e) => {
      if (!isDrawing) {
        return;
      }

      ctx.lineTo(e.offsetX, e.offsetY);
      ctx.stroke();
      ctx.lineWidth = 10;
    }

    //Mouse down start draw
    const startDraw = () => {
      isDrawing = true;
      ctx.beginPath();
    }

    //Set drawing back to false when done drawing
    const stopDraw = () => {
      isDrawing = false;
    }
    ///Mouse Event listeners
    canvas.addEventListener("mousemove", drawing);
    canvas.addEventListener("mouseup", stopDraw);
    canvas.addEventListener("mousedown", startDraw);

    setInterval(function () {
      image.src = canvas.toDataURL()
    }, 100);
  }, [])

  function makePrediction() {
    generatePrediction(image);
  }

  return (

      <canvas id="myCanvas" width="280" height="280" ref={canvasRef} {...props} />

 The Guessed Number Is:

      <button onClick={makePrediction}>Submit</button>

  )
}

export default Canvas

And this is the result:
Prediction Results

Even if I redraw a new number and press submit to predict, it shows the same values.

Prediction values exactly the same given a new number

Is there any reason why this happens?

I suspect it's the image I pass in and if it's formatted correctly.


问:
How can I programmatically record audio and video of the Android Studio emulator screen?
I tried using the adb screenrecord command, but it only records the screen without audio. The Extended Controls Record and Playback feature appears to be the only way to record the screen with audio, but it is a manual process. Is there a way to access this tool programmatically to automate the recording of audio and video from the emulator or is there any way that I can use Android Debug Bridge command line tool (adb) to do this?

Thank you for your help.

Extended Controls Record and Playback

https://developer.android.com/studio/debug/am-video#record-video-with-the-emulator

adb screenrecord command

https://developer.android.com/studio/command-line/adb#screenrecord


问:
CropperJS misconfigured when viewport height changes
On this StackBlitz: https://stackblitz.com/edit/modal-cropper-issue?file=index.html

I have the following code:

<!DOCTYPE html>

<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Modal + Cropper</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.1.3/cropper.css" />

Modal + CropperJS Example

  <button id="buttonOpenModal">Open Modal</button>

      X
      <button onclick="setImage('https://i.ibb.co/jZBdmCk/image.png');">Set Image</button>

```

The issue

When the viewport changes the height the CropperJS gets misconfigured.

Reproduce steps

Go to: https://stackblitz.com/edit/modal-cropper-issue?file=index.html

Open StackBlitz built-in Console (small height is enough)

Click button: Open Modal

Click button: Set Image → Image and cropper properly displayed

Close the modal

Click button: Open Modal → Image and cropper properly displayed

Close the modal

Resize (height) just a bit the StackBlitz built-in Console

Click button: Open Modal → Image and cropper NOT properly displayed

Screenshots

before...

after...

Any idea on how to solve this issue?

Thanks!

Body:
On this StackBlitz: https://stackblitz.com/edit/modal-cropper-issue?file=index.html

I have the following code:

<!DOCTYPE html>

<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Modal + Cropper</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/cropperjs/1.1.3/cropper.css" />

Modal + CropperJS Example

  <button id="buttonOpenModal">Open Modal</button>

      X
      <button onclick="setImage('https://i.ibb.co/jZBdmCk/image.png');">Set Image</button>

The issue

When the viewport changes the height the CropperJS gets misconfigured.

Reproduce steps

Go to: https://stackblitz.com/edit/modal-cropper-issue?file=index.html

Open StackBlitz built-in Console (small height is enough)

Click button: Open Modal

Click button: Set Image → Image and cropper properly displayed

Close the modal

Click button: Open Modal → Image and cropper properly displayed

Close the modal

Resize (height) just a bit the StackBlitz built-in Console

Click button: Open Modal → Image and cropper NOT properly displayed

Screenshots

before...

after...

Any idea on how to solve this issue?

Thanks!


问:
TypeError: cannot pickle '_queue.SimpleQueue' object multiprocessing
```<code>async def main():
    print(message)
    queue = multiprocessing.Queue()
    apps = []
    combs = batched(combinations, 200)
    chat_id = obtain_chats_id()
    workers = []
    print(f'~~~Parsing channel {chat_id} ~~~')
    try:
        async for i in async_range(num_workers):
            async with Client(f'session_{i}', api_hash=api_hash, api_id=api_id) as app:
                apps.append(app)
        for app, comb in zip(apps, combs):
            worker = mp.Process(target=get_users_info, args=(app, queue, chat_id, comb))
            workers.append(worker)
            worker.start()
        for worker in workers:
            worker.join()
        num_done = 0
        while num_done < num_workers:
            msg = queue.get()
            if msg == "DONE":
                num_done += 1
            else:
                final_set.update(msg)
    finally:
        save_excel()
</code>```

When I try to run my program I got this error, have know idea what I do wrong.

The reason I need multiprocessing is that you can run pyrogram session in separate process.

I want to make several processes that each would start pyrogram Client in parallel way.

Then each process sends to the queue message with(set object with parsed users)

It had to start processes and then make final set of parseds telegram users, but I got error

Body:
async def main():
    print(message)
    queue = multiprocessing.Queue()
    apps = []
    combs = batched(combinations, 200)
    chat_id = obtain_chats_id()
    workers = []
    print(f'~~~Parsing channel {chat_id} ~~~')
    try:
        async for i in async_range(num_workers):
            async with Client(f'session_{i}', api_hash=api_hash, api_id=api_id) as app:
                apps.append(app)
        for app, comb in zip(apps, combs):
            worker = mp.Process(target=get_users_info, args=(app, queue, chat_id, comb))
            workers.append(worker)
            worker.start()
        for worker in workers:
            worker.join()
        num_done = 0
        while num_done < num_workers:
            msg = queue.get()
            if msg == "DONE":
                num_done += 1
            else:
                final_set.update(msg)
    finally:
        save_excel()

When I try to run my program I got this error, have know idea what I do wrong.

The reason I need multiprocessing is that you can run pyrogram session in separate process.

I want to make several processes that each would start pyrogram Client in parallel way.

Then each process sends to the queue message with(set object with parsed users)

It had to start processes and then make final set of parseds telegram users, but I got error


问:
How to draw a horizontal line conditionally?
A script creates a quasi boolean flag lowBar 0 / 1 to control the visibility of an indicator line.

When that flag is used to control the visibility of a line, then the chart is not displayed, as if it disappears into the chart background.

However, the chart is stretched vertically in line with the vertical extension of the indicator so one can see that the indicator is not entirely gone while at the same time it is completely invisible.

Hover with your mouse over the bars on the upper chart and you can see the correct values 1 and N/A displayed in the status bar between upper and lower chart, with the duration of the 1 value exactly one bar as expected.

```<code>def lowBar = CompoundValue(1, if(low < low[1] && low < low[-1]) then 1 else 0, 0);
declare lower;
plot testPlot = if(lowBar) then 1 else Double.NaN;
testPlot.AssignValueColor(Color.RED);
</code>```

Body:
A script creates a quasi boolean flag lowBar 0 / 1 to control the visibility of an indicator line.

When that flag is used to control the visibility of a line, then the chart is not displayed, as if it disappears into the chart background.

However, the chart is stretched vertically in line with the vertical extension of the indicator so one can see that the indicator is not entirely gone while at the same time it is completely invisible.

Hover with your mouse over the bars on the upper chart and you can see the correct values 1 and N/A displayed in the status bar between upper and lower chart, with the duration of the 1 value exactly one bar as expected.

def lowBar = CompoundValue(1, if(low < low[1] && low < low[-1]) then 1 else 0, 0);
declare lower;
plot testPlot = if(lowBar) then 1 else Double.NaN;
testPlot.AssignValueColor(Color.RED);


问:
Playstore continue button not visible in xiaomi devices
On click firebase dynamic link, it redirects to play store. On app install there should be Continue button for complete dynamic link flow. But in Xiaomi another app open which shows only Open button.

How I can achieve dynamic link behavior in Xiaomi devices also.


问:
JPA: don't update specific fields using random function
Is there anyway, don't update specific fields which are randomly generated using @DynamicUpdate

For example, i have jpa entity like this:

```<code>@Data
@Entity
@Table(name = "Classes")
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
@ToString
@DynamicUpdate
public class Classes {

    @Id
    @Column(name = "ClassId")
    private Long classId;

    @Column(name = "CourseSourceId")
    private String courseSourceId;
    @Column(name = "Name")
    private String name;
    @Column(name = "Grades",updatable = false)
    private String grades;
    @Column(name = "CourseId")
    private String courseId;
    @Column(name = "ClassCode",updatable = false)
    private String classCode;
    @Column(name = "Subjects")
    private String subjects;
    @Column(name = "SubjectCodes")
    private String subjectCodes;
    @Column(name = "Periods")
    private String periods;
    @Column(name = "StaffSectionCode",updatable = false)
    private String staffSectionCode;
    @Column(name = "StudentSectionCode",updatable = false)
    private String studentSectionCode;

}

</code>```

When i use (updatable=false) on grades column it's not updated, but StaffSectionCode and studentSectionCode are getting updated because i am using math.random function.

Here is my controller class, i am handling both post and put functionality in a same class.

```<code>@PostMapping(value = "/addClasses")
@PreAuthorize("hasAuthority('Write')")
public ResponseEntity<Object> saveCLasses(@Valid @RequestBody AddClassesCommand command, @RequestHeader(ClassesConstants.AUTHORIZATION) String token) {
    try {
        log.info("saveCLasses {} Service Calling...");
        Long id = UniqueIdentifierGenerate.get64MostSignificantBitsForVersion1();
        command.setId(id);
        Date date = new Date();
        Long time = date.getTime() + (int) (Math.random() * 100);
        command.getClasses().setStaffAccessCode(ApplicationConstants.STAFF_SECTION_CODE + time);
        Long std = date.getTime() + (int) (Math.random() * 100);
        command.getClasses().setStudentAccessCode(ApplicationConstants.STUDENT_SECTION_CODE + std);
        command.setUctx(TokenConversion.getUserContextJson(token));
        commandGateway.sendAndWait(command);
        command.setUctx(null);
        log.info("saveClasses {} Service Complete successfully...");
        return new ResponseEntity<>(new CreatedResponse(id, ClassesConstants.getSuccessMessage
                (ClassesConstants.CLASSES, ClassesConstants.CREATE), command, true), HttpStatus.CREATED);

    } catch (Exception e) {
        logger.info(e.getMessage());
        var safeErrorMessage = ClassesConstants.CREATE_ERROR_MSG;
        return new ResponseEntity<>(safeErrorMessage, HttpStatus.INTERNAL_SERVER_ERROR);
    }
}
</code>```

Here is my @eventHandler class where i am hanlding update functionality.

```<code>private Classes saveClasses(AddClassesEvent event, ActiveSessionInfo activeSessionInfo) {
    try {
        log.info("saveClasses {} calling...");
/**
 if (event.getClasses().getClassId() != null) {
                guid = event.getClasses().getClassId();
            } else {
                guid = event.getId().toString();
            }

        var existingId = classesRepository.findByGuid(guid);
        if (existingId != null) {
            cls = existingId;
        } else {
            cls.setGuid(event.getId().toString());
            cls.setClassId(classesRepository.findNextValFromClasses_Seq()+100);
            classesHelper.updateSeqValueInDb(ApplicationConstants.DEFAULT_CLASSES_SEQUENCE, cls.getClassId(), 1l);
        }
**/ between this function i want to update fields and in else case i want to create fields data.

        cls.setName(event.getClasses().getClassName());
        cls.setOrgId(event.getClasses().getOrgId());
        if (activeSessionInfo != null && activeSessionInfo.getYearId() != null) {
            cls.setSchoolYearId(activeSessionInfo.getYearId());
        }
        cls.setPeriods(event.getClasses().getPeriod());
        cls.setCourseId(event.getClasses().getCourseId());
        if (activeSessionInfo != null && activeSessionInfo.getTenantId() != null) {
            cls.setTenantId(activeSessionInfo.getTenantId());
        }
        cls.setStaffSectionCode(event.getClasses().getStaffAccessCode());
        cls.setStudentSectionCode(event.getClasses().getStudentAccessCode());

        classesRepository.saveAndFlush(cls);
        saveCoTeacherEnrollmentDetails(event, cls.getClassId(), activeSessionInfo);
        log.info("saveClasses {} calling end...");

        return cls;
    } catch (Exception ex) {
        log.error(ex.getMessage());
        return null;
    }
}
</code>```

Body:
Is there anyway, don't update specific fields which are randomly generated using @DynamicUpdate

For example, i have jpa entity like this:

@Data
@Entity
@Table(name = "Classes")
@NoArgsConstructor
@AllArgsConstructor
@Getter
@Setter
@JsonInclude(JsonInclude.Include.NON_NULL)
@ToString
@DynamicUpdate
public class Classes {

    @Id
    @Column(name = "ClassId")
    private Long classId;

    @Column(name = "CourseSourceId")
    private String courseSourceId;
    @Column(name = "Name")
    private String name;
    @Column(name = "Grades",updatable = false)
    private String grades;
    @Column(name = "CourseId")
    private String courseId;
    @Column(name = "ClassCode",updatable = false)
    private String classCode;
    @Column(name = "Subjects")
    private String subjects;
    @Column(name = "SubjectCodes")
    private String subjectCodes;
    @Column(name = "Periods")
    private String periods;
    @Column(name = "StaffSectionCode",updatable = false)
    private String staffSectionCode;
    @Column(name = "StudentSectionCode",updatable = false)
    private String studentSectionCode;

}

When i use (updatable=false) on grades column it's not updated, but StaffSectionCode and studentSectionCode are getting updated because i am using math.random function.

Here is my controller class, i am handling both post and put functionality in a same class.

@PostMapping(value = "/addClasses")
@PreAuthorize("hasAuthority('Write')")
public ResponseEntity<Object> saveCLasses(@Valid @RequestBody AddClassesCommand command, @RequestHeader(ClassesConstants.AUTHORIZATION) String token) {
    try {
        log.info("saveCLasses {} Service Calling...");
        Long id = UniqueIdentifierGenerate.get64MostSignificantBitsForVersion1();
        command.setId(id);
        Date date = new Date();
        Long time = date.getTime() + (int) (Math.random() * 100);
        command.getClasses().setStaffAccessCode(ApplicationConstants.STAFF_SECTION_CODE + time);
        Long std = date.getTime() + (int) (Math.random() * 100);
        command.getClasses().setStudentAccessCode(ApplicationConstants.STUDENT_SECTION_CODE + std);
        command.setUctx(TokenConversion.getUserContextJson(token));
        commandGateway.sendAndWait(command);
        command.setUctx(null);
        log.info("saveClasses {} Service Complete successfully...");
        return new ResponseEntity<>(new CreatedResponse(id, ClassesConstants.getSuccessMessage
                (ClassesConstants.CLASSES, ClassesConstants.CREATE), command, true), HttpStatus.CREATED);

    } catch (Exception e) {
        logger.info(e.getMessage());
        var safeErrorMessage = ClassesConstants.CREATE_ERROR_MSG;
        return new ResponseEntity<>(safeErrorMessage, HttpStatus.INTERNAL_SERVER_ERROR);
    }
}

Here is my @eventHandler class where i am hanlding update functionality.

private Classes saveClasses(AddClassesEvent event, ActiveSessionInfo activeSessionInfo) {
    try {
        log.info("saveClasses {} calling...");
/**
 if (event.getClasses().getClassId() != null) {
                guid = event.getClasses().getClassId();
            } else {
                guid = event.getId().toString();
            }

        var existingId = classesRepository.findByGuid(guid);
        if (existingId != null) {
            cls = existingId;
        } else {
            cls.setGuid(event.getId().toString());
            cls.setClassId(classesRepository.findNextValFromClasses_Seq()+100);
            classesHelper.updateSeqValueInDb(ApplicationConstants.DEFAULT_CLASSES_SEQUENCE, cls.getClassId(), 1l);
        }
**/ between this function i want to update fields and in else case i want to create fields data.

        cls.setName(event.getClasses().getClassName());
        cls.setOrgId(event.getClasses().getOrgId());
        if (activeSessionInfo != null && activeSessionInfo.getYearId() != null) {
            cls.setSchoolYearId(activeSessionInfo.getYearId());
        }
        cls.setPeriods(event.getClasses().getPeriod());
        cls.setCourseId(event.getClasses().getCourseId());
        if (activeSessionInfo != null && activeSessionInfo.getTenantId() != null) {
            cls.setTenantId(activeSessionInfo.getTenantId());
        }
        cls.setStaffSectionCode(event.getClasses().getStaffAccessCode());
        cls.setStudentSectionCode(event.getClasses().getStudentAccessCode());

        classesRepository.saveAndFlush(cls);
        saveCoTeacherEnrollmentDetails(event, cls.getClassId(), activeSessionInfo);
        log.info("saveClasses {} calling end...");

        return cls;
    } catch (Exception ex) {
        log.error(ex.getMessage());
        return null;
    }
}


问:
Struct initialization changes in C++ 20

#include <memory>

struct Something
{
    int x;
    long y;
};

int main()
{
    std::unique_ptr<Something> k = std::make_unique<Something>(0, 1);
    return 0;
}

```

This program compiles with g++ --std=c20. Why?

I could not deduce from this list which change supports this.

Compilation fails with g++ --std=c2a for obvious reasons.

Title: Struct initialization changes in C++ 20

Body:
#include <memory>

struct Something
{
    int x;
    long y;
};

int main()
{
    std::unique_ptr<Something> k = std::make_unique<Something>(0, 1);
    return 0;
}

This program compiles with g++ --std=c20. Why?

I could not deduce from this list which change supports this.

Compilation fails with g++ --std=c2a for obvious reasons.


问:
How to read a huge CSV file efficiently and convert CSV values into objects based on a user-defined class in Java
I have to read a large CSV file with about 700,000 records and compare the CSV data to an API response. I was able to use OpenCSV and make the code work. However, the deserialization process is extremely slow. It takes about an hour just to deserialize the data. I have been using the following code to read and deserialize my CSV.

```<code>     List<ProjectVO> csvValue = new CsvToBeanBuilder(new FileReader("project.csv"))
       .withType(ProjectVO.class).build().parse();
</code>```

Is there any other efficient method to replace it?

My PersonVO class looks like this:

```<code>.
.
.
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProjectVO {
@JsonProperty("actualCompletionDate")
@CsvBindByName(column = "actualCompletionDate")
private String actualCompletionDate;
.
.
.
</code>```

I am comparing my CSV data and JSON response something like following:

```<code>assertEquals("The value for column 'actualCompletionDate' has the same data in both files for the ID: "
   + jsonValue.getId(), csvValue.getActualCompletionDate(), jsonValue.getActualCompletionDate());
</code>```

Body:
I have to read a large CSV file with about 700,000 records and compare the CSV data to an API response. I was able to use OpenCSV and make the code work. However, the deserialization process is extremely slow. It takes about an hour just to deserialize the data. I have been using the following code to read and deserialize my CSV.

     List<ProjectVO> csvValue = new CsvToBeanBuilder(new FileReader("project.csv"))
       .withType(ProjectVO.class).build().parse();

Is there any other efficient method to replace it?

My PersonVO class looks like this:

.
.
.
@JsonIgnoreProperties(ignoreUnknown = true)
public class ProjectVO {
@JsonProperty("actualCompletionDate")
@CsvBindByName(column = "actualCompletionDate")
private String actualCompletionDate;
.
.
.

I am comparing my CSV data and JSON response something like following:

assertEquals("The value for column 'actualCompletionDate' has the same data in both files for the ID: "
   + jsonValue.getId(), csvValue.getActualCompletionDate(), jsonValue.getActualCompletionDate());


问:
Replication Error in Redis cluster using Docker Compose
I am using a Redis cluster with one master and two slaves. Also, automatic failover using Sentinel.
The cluster is configured using docker-compose.

The Redis image version is 6.2.

I am getting the below error in Redis slave servers when I start docker:

```<code>redis-slave       | 1:S 13 Dec 2022 15:17:44.634 # == CRITICAL == This replica is sending an error to its master: 'The ID specified in XADD is equal or smaller than the target stream top item' after processing the command 'exec'
redis-slave       | 1:S 13 Dec 2022 15:17:44.634 # Latest backlog is: '"CgDeksKIgogChRsc3RjLWxvcmF3YW4tZ2F0ZXdheRIIAABYE9MXZpMQy86YBRoLCNGs4pwGEPTk9gEg+PmlyKjFZioLCMKv4pwGEMCSix2IAQKqAQsIwq/inAYQwJKLHbIBDAjQrOKcBhDRwdHXAzonCg0KCwjI0AcQBxoDNC81IOD/050DMMvOmAU6CwjCr+KcBhDAkosdQgsI0azinAYQ2rH0AlgBagUQgND5MIIBDQoDAAATEgZpbmZyYXg\r\n"'
redis-slave       | 1:S 13 Dec 2022 15:18:00.902 # == CRITICAL == This replica is sending an error to its master: 'The ID specified in XADD is equal or smaller than the target stream top item' after processing the command 'xadd'
redis-slave       | 1:S 13 Dec 2022 15:18:00.902 # Latest backlog is: '"infrax:list\r\n$26\r\n01gm60pvfb3tmcj43hqe0dtwdz\r\n*3\r\n$7\r\npexpire\r\n$63\r\nttn:v3:ns:devices:uid:infrax-use-cases.db-ai-sensor@infrax:lock\r\n$5\r\n10000\r\n*3\r\n$7\r\npexpire\r\n$63\r\nttn:v3:ns:devices:uid:infrax-use-cases.db-ai-sensor@infrax:list\r\n$5\r\n10000\r\n*1\r\n$4\r\nEXEC\r\n"'
redis-slave       | 1:S 13 Dec 2022 15:18:01.114 # == CRITICAL == This replica is sending an error to its master: 'The ID specified in XADD is equal or smaller than the target stream top item' after processing the command 'exec'
redis-slave       | 1:S 13 Dec 2022 15:18:01.115 # Latest backlog is: '"LWQtZ2F0ZXdheRIIAABYE9NeLbgQlNfXxgEaDAjhrOKcBhC47YTXAyCg9ICdkNRlKgsI06/inAYQgPizNYgBBqoBCwjTr+KcBhCA+LM1sgEMCOGs4pwGEJDQ2ccD\r\n*3\r\n$7\r\npexpire\r\n$82\r\nttn:v3:ns:uplink-deduplication:SvlQW6CRSGE:ps2d70:CgsIyNAHEAwaAzQvNQ:0:infrax:list\r\n$4\r\n1200\r\n*1\r\n$4\r\nEXEC\r\n"'
</code>```

Below is configuration details:

docker-compose.yml(redis-master):

```<code>redis-master:
    container_name: "redis-master"
    image: redis:6.2
    ports:
      - "6379:6379"
    command: "redis-server /etc/redis.conf"
    restart: unless-stopped
    volumes:
      - "./data/master:/data/"
      - "./master.conf:/etc/redis.conf"

  redis-sentinel:
    container_name: 'redis-sentinel'
    image: redis:6.2
    ports:
      - "26379:26379"
    command: "redis-server /etc/sentinel.conf --sentinel"
    volumes:
      - "./sentinel.conf:/etc/sentinel.conf"
</code>```

docker-compose.yml(slave)

```<code>redis-slave:
    container_name: "redis-slave"
    image: redis:6.2
    ports:
      - "6379:6379"
    command: "redis-server /etc/redis.conf"
    restart: unless-stopped
    volumes:
      - "./data/slave:/data/"
      - "./slave.conf:/etc/redis.conf"

  redis-sentinel:
    container_name: 'redis-sentinel'
    image: redis:latest
    ports:
      - "26379:26379"
    command: "redis-server /etc/sentinel.conf --sentinel"
    volumes:
      - "./sentinel.conf:/etc/sentinel.conf"
</code>```

Let me know if you need master.conf, slave.conf and sentinel.conf files. I will share those to if required.

I tried to restore the slave system using rdb backup. But, still got the same error.

I want to understand whether I can ignore this error safely. If not then please help to resolve this error.

Thanks & Regards.

Body:
I am using a Redis cluster with one master and two slaves. Also, automatic failover using Sentinel.
The cluster is configured using docker-compose.

The Redis image version is 6.2.

I am getting the below error in Redis slave servers when I start docker:

redis-slave       | 1:S 13 Dec 2022 15:17:44.634 # == CRITICAL == This replica is sending an error to its master: 'The ID specified in XADD is equal or smaller than the target stream top item' after processing the command 'exec'
redis-slave       | 1:S 13 Dec 2022 15:17:44.634 # Latest backlog is: '"CgDeksKIgogChRsc3RjLWxvcmF3YW4tZ2F0ZXdheRIIAABYE9MXZpMQy86YBRoLCNGs4pwGEPTk9gEg+PmlyKjFZioLCMKv4pwGEMCSix2IAQKqAQsIwq/inAYQwJKLHbIBDAjQrOKcBhDRwdHXAzonCg0KCwjI0AcQBxoDNC81IOD/050DMMvOmAU6CwjCr+KcBhDAkosdQgsI0azinAYQ2rH0AlgBagUQgND5MIIBDQoDAAATEgZpbmZyYXg\r\n"'
redis-slave       | 1:S 13 Dec 2022 15:18:00.902 # == CRITICAL == This replica is sending an error to its master: 'The ID specified in XADD is equal or smaller than the target stream top item' after processing the command 'xadd'
redis-slave       | 1:S 13 Dec 2022 15:18:00.902 # Latest backlog is: '"infrax:list\r\n$26\r\n01gm60pvfb3tmcj43hqe0dtwdz\r\n*3\r\n$7\r\npexpire\r\n$63\r\nttn:v3:ns:devices:uid:infrax-use-cases.db-ai-sensor@infrax:lock\r\n$5\r\n10000\r\n*3\r\n$7\r\npexpire\r\n$63\r\nttn:v3:ns:devices:uid:infrax-use-cases.db-ai-sensor@infrax:list\r\n$5\r\n10000\r\n*1\r\n$4\r\nEXEC\r\n"'
redis-slave       | 1:S 13 Dec 2022 15:18:01.114 # == CRITICAL == This replica is sending an error to its master: 'The ID specified in XADD is equal or smaller than the target stream top item' after processing the command 'exec'
redis-slave       | 1:S 13 Dec 2022 15:18:01.115 # Latest backlog is: '"LWQtZ2F0ZXdheRIIAABYE9NeLbgQlNfXxgEaDAjhrOKcBhC47YTXAyCg9ICdkNRlKgsI06/inAYQgPizNYgBBqoBCwjTr+KcBhCA+LM1sgEMCOGs4pwGEJDQ2ccD\r\n*3\r\n$7\r\npexpire\r\n$82\r\nttn:v3:ns:uplink-deduplication:SvlQW6CRSGE:ps2d70:CgsIyNAHEAwaAzQvNQ:0:infrax:list\r\n$4\r\n1200\r\n*1\r\n$4\r\nEXEC\r\n"'

Below is configuration details:

docker-compose.yml(redis-master):

redis-master:
    container_name: "redis-master"
    image: redis:6.2
    ports:
      - "6379:6379"
    command: "redis-server /etc/redis.conf"
    restart: unless-stopped
    volumes:
      - "./data/master:/data/"
      - "./master.conf:/etc/redis.conf"

  redis-sentinel:
    container_name: 'redis-sentinel'
    image: redis:6.2
    ports:
      - "26379:26379"
    command: "redis-server /etc/sentinel.conf --sentinel"
    volumes:
      - "./sentinel.conf:/etc/sentinel.conf"

docker-compose.yml(slave)

redis-slave:
    container_name: "redis-slave"
    image: redis:6.2
    ports:
      - "6379:6379"
    command: "redis-server /etc/redis.conf"
    restart: unless-stopped
    volumes:
      - "./data/slave:/data/"
      - "./slave.conf:/etc/redis.conf"

  redis-sentinel:
    container_name: 'redis-sentinel'
    image: redis:latest
    ports:
      - "26379:26379"
    command: "redis-server /etc/sentinel.conf --sentinel"
    volumes:
      - "./sentinel.conf:/etc/sentinel.conf"

Let me know if you need master.conf, slave.conf and sentinel.conf files. I will share those to if required.

I tried to restore the slave system using rdb backup. But, still got the same error.

I want to understand whether I can ignore this error safely. If not then please help to resolve this error.

Thanks & Regards.


问:
Data in the table view won't show
I want to show data in my table view, but the data won't show, based on the youtube video I have watched on here the data should show based on the dummy data I have inputed. Here's my code for the view controller and viewcell

MenuViewController

```<code>import UIKit
import SwiftUI

class MenuViewController: UIViewController, UISearchBarDelegate {

    let searchBar:UISearchBar = UISearchBar()

    // Table View
    let tableView = UITableView()
    var menus: [Menu] = []

    struct Cells {
        static let menuTableViewCell = "MenuTableViewCell"
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        // Table View
        configureTableView()
        menus = fetchData()

        view.backgroundColor = .white
        view.tintColor = .black

        // Title
        self.navigationItem.title = "Dashboard"
        navigationController?.navigationBar.prefersLargeTitles = true

        // Search Bar
        searchBar.searchBarStyle = UISearchBar.Style.default
        searchBar.placeholder = "Search menu..."
        searchBar.sizeToFit()
        searchBar.isTranslucent = false
        searchBar.backgroundImage = UIImage()
        searchBar.delegate = self
        navigationItem.titleView = searchBar
    }

    func searchBar(_ searchBar: UISearchBar, textDidChange textSearched: String) {
        // code
    }

    func configureTableView() {
        view.addSubview(tableView)
        setTableViewDelegates()
        tableView.rowHeight = 120
        tableView.register(MenuTableViewCell.self, forCellReuseIdentifier: Cells.menuTableViewCell)
        tableView.pin(to: view)
    }

    func setTableViewDelegates(){
        tableView.delegate = self
        tableView.dataSource = self
    }
}

extension MenuViewController: UITableViewDelegate, UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return menus.count
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: Cells.menuTableViewCell) as! MenuTableViewCell
        let menu = menus[indexPath.row]
        cell.set(menu: menu)

        return UITableViewCell()
    }
}

// Dummy data
extension MenuViewController {
    func fetchData() -> [Menu] {
        let cake1 = Menu(image: CakeImages.cake1!, category: "Cheesecake", name: "Choco Hazelnut Cheesecake", size: "16 cm (125k) & 20cm (225k)")
        let cake2 = Menu(image: CakeImages.cake2!, category: "Cheesecake", name: "Lotus Cheesecake", size: "16 cm (115k) & 20cm (215k)")
        let cake3 = Menu(image: CakeImages.cake3!, category: "Cheesecake", name: "Oreo Cheesecake", size: "16 cm (115k) & 20cm (215k)")
        let cake4 = Menu(image: CakeImages.cake4!, category: "Cheesecake", name: "Strawberry Cheesecake", size: "16 cm (125k) & 20cm (225k)")
        let cake5 = Menu(image: CakeImages.cake5!, category: "Cheesecake", name: "Blueberry Cheesecake", size: "16 cm (135k) & 20cm (235k)")
        let cake6 = Menu(image: CakeImages.cake6!, category: "Cheesecake", name: "Orange Marmalade Cheesecake", size: "16 cm (125k) & 20cm (225k)")
        let cake7 = Menu(image: CakeImages.cake7!, category: "Fresh Cream", name: "Strawberry Shortcake", size: "15 cm (195k)")
        let cake8 = Menu(image: CakeImages.cake8!, category: "Fresh Cream", name: "Fraisier Cheese Cake", size: "15 cm (195k)")
        let cake9 = Menu(image: CakeImages.cake9!, category: "Fresh Cream", name: "Chocolate Cake", size: "15 cm (195k)")
        let cake10 = Menu(image: CakeImages.cake10!, category: "Fresh Cream", name: "Vanilla Lotus Biscoff", size: "15 cm (195k)")

        return [cake1, cake2, cake3, cake4, cake5, cake6, cake7, cake8, cake9, cake10]

    }
}

</code>```

MenuTableViewCell

```<code>import UIKit

class MenuTableViewCell: UITableViewCell {

    // Menu variable
    var cakeImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 96, height: 96))
    let cakeCategory = UILabel()
    let cakeName = UILabel()
    let cakeSize = UILabel()

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        addSubview(cakeImageView)
        addSubview(cakeCategory)
        addSubview(cakeName)
        addSubview(cakeSize)

        // Layout
        configureImageView()
        configureCakeCategory()
        configureCakeName()
        configureCakeSize()

        // Constraints
        setImageConstraints()
        setCakeCategoryConstraints()
        setCakeNameConstraints()
        setCakeSizeConstraints()
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    func set(menu: Menu) {
        cakeImageView.image = menu.image
        cakeCategory.text = menu.category
        cakeName.text = menu.name
        cakeSize.text = menu.size
    }

    // Image View
    func configureImageView() {
        cakeImageView.layer.cornerRadius = 6
        cakeImageView.clipsToBounds = true
    }

    func setImageConstraints() {
        cakeImageView.translatesAutoresizingMaskIntoConstraints = false
        cakeImageView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        cakeImageView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16).isActive = true
        cakeImageView.heightAnchor.constraint(equalToConstant: 120).isActive = true
        cakeImageView.widthAnchor.constraint(equalTo: cakeImageView.heightAnchor).isActive = true

    }

    // Cake Category
    func configureCakeCategory() {
        cakeCategory.numberOfLines = 0
        cakeCategory.adjustsFontSizeToFitWidth = true
    }

    func setCakeCategoryConstraints() {
        cakeCategory.translatesAutoresizingMaskIntoConstraints = false
        cakeCategory.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        cakeCategory.leadingAnchor.constraint(equalTo: cakeImageView.trailingAnchor, constant: 20).isActive = true
        cakeCategory.heightAnchor.constraint(equalToConstant: 80).isActive = true
        cakeCategory.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16).isActive = true    }

    // Cake Name
    func configureCakeName() {
        cakeName.numberOfLines = 0
        cakeName.adjustsFontSizeToFitWidth = true
    }

    func setCakeNameConstraints() {
        cakeName.translatesAutoresizingMaskIntoConstraints = false
        cakeName.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        cakeName.leadingAnchor.constraint(equalTo: cakeImageView.trailingAnchor, constant: 20).isActive = true
        cakeName.heightAnchor.constraint(equalToConstant: 80).isActive = true
        cakeName.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16).isActive = true
    }

    // Cake Size
    func configureCakeSize() {
        cakeSize.numberOfLines = 0
        cakeSize.adjustsFontSizeToFitWidth = true
    }

    func setCakeSizeConstraints() {
        cakeSize.translatesAutoresizingMaskIntoConstraints = false
        cakeSize.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        cakeSize.leadingAnchor.constraint(equalTo: cakeImageView.trailingAnchor, constant: 20).isActive = true
        cakeSize.heightAnchor.constraint(equalToConstant: 80).isActive = true
        cakeSize.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16).isActive = true

    }

}
</code>```

The data should be shown, if I try to add more data to the table view, the row increase, but the data won't show

Title: Data in the table view won't show

Body:
I want to show data in my table view, but the data won't show, based on the youtube video I have watched on here the data should show based on the dummy data I have inputed. Here's my code for the view controller and viewcell

MenuViewController

import UIKit
import SwiftUI

class MenuViewController: UIViewController, UISearchBarDelegate {

    let searchBar:UISearchBar = UISearchBar()

    // Table View
    let tableView = UITableView()
    var menus: [Menu] = []

    struct Cells {
        static let menuTableViewCell = "MenuTableViewCell"
    }

    override func viewDidLoad() {
        super.viewDidLoad()

        // Table View
        configureTableView()
        menus = fetchData()

        view.backgroundColor = .white
        view.tintColor = .black

        // Title
        self.navigationItem.title = "Dashboard"
        navigationController?.navigationBar.prefersLargeTitles = true

        // Search Bar
        searchBar.searchBarStyle = UISearchBar.Style.default
        searchBar.placeholder = "Search menu..."
        searchBar.sizeToFit()
        searchBar.isTranslucent = false
        searchBar.backgroundImage = UIImage()
        searchBar.delegate = self
        navigationItem.titleView = searchBar
    }

    func searchBar(_ searchBar: UISearchBar, textDidChange textSearched: String) {
        // code
    }

    func configureTableView() {
        view.addSubview(tableView)
        setTableViewDelegates()
        tableView.rowHeight = 120
        tableView.register(MenuTableViewCell.self, forCellReuseIdentifier: Cells.menuTableViewCell)
        tableView.pin(to: view)
    }

    func setTableViewDelegates(){
        tableView.delegate = self
        tableView.dataSource = self
    }
}

extension MenuViewController: UITableViewDelegate, UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return menus.count
    }

    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let cell = tableView.dequeueReusableCell(withIdentifier: Cells.menuTableViewCell) as! MenuTableViewCell
        let menu = menus[indexPath.row]
        cell.set(menu: menu)

        return UITableViewCell()
    }
}

// Dummy data
extension MenuViewController {
    func fetchData() -> [Menu] {
        let cake1 = Menu(image: CakeImages.cake1!, category: "Cheesecake", name: "Choco Hazelnut Cheesecake", size: "16 cm (125k) & 20cm (225k)")
        let cake2 = Menu(image: CakeImages.cake2!, category: "Cheesecake", name: "Lotus Cheesecake", size: "16 cm (115k) & 20cm (215k)")
        let cake3 = Menu(image: CakeImages.cake3!, category: "Cheesecake", name: "Oreo Cheesecake", size: "16 cm (115k) & 20cm (215k)")
        let cake4 = Menu(image: CakeImages.cake4!, category: "Cheesecake", name: "Strawberry Cheesecake", size: "16 cm (125k) & 20cm (225k)")
        let cake5 = Menu(image: CakeImages.cake5!, category: "Cheesecake", name: "Blueberry Cheesecake", size: "16 cm (135k) & 20cm (235k)")
        let cake6 = Menu(image: CakeImages.cake6!, category: "Cheesecake", name: "Orange Marmalade Cheesecake", size: "16 cm (125k) & 20cm (225k)")
        let cake7 = Menu(image: CakeImages.cake7!, category: "Fresh Cream", name: "Strawberry Shortcake", size: "15 cm (195k)")
        let cake8 = Menu(image: CakeImages.cake8!, category: "Fresh Cream", name: "Fraisier Cheese Cake", size: "15 cm (195k)")
        let cake9 = Menu(image: CakeImages.cake9!, category: "Fresh Cream", name: "Chocolate Cake", size: "15 cm (195k)")
        let cake10 = Menu(image: CakeImages.cake10!, category: "Fresh Cream", name: "Vanilla Lotus Biscoff", size: "15 cm (195k)")

        return [cake1, cake2, cake3, cake4, cake5, cake6, cake7, cake8, cake9, cake10]

    }
}

MenuTableViewCell

import UIKit

class MenuTableViewCell: UITableViewCell {

    // Menu variable
    var cakeImageView = UIImageView(frame: CGRect(x: 0, y: 0, width: 96, height: 96))
    let cakeCategory = UILabel()
    let cakeName = UILabel()
    let cakeSize = UILabel()

    override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        addSubview(cakeImageView)
        addSubview(cakeCategory)
        addSubview(cakeName)
        addSubview(cakeSize)

        // Layout
        configureImageView()
        configureCakeCategory()
        configureCakeName()
        configureCakeSize()

        // Constraints
        setImageConstraints()
        setCakeCategoryConstraints()
        setCakeNameConstraints()
        setCakeSizeConstraints()
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    func set(menu: Menu) {
        cakeImageView.image = menu.image
        cakeCategory.text = menu.category
        cakeName.text = menu.name
        cakeSize.text = menu.size
    }

    // Image View
    func configureImageView() {
        cakeImageView.layer.cornerRadius = 6
        cakeImageView.clipsToBounds = true
    }

    func setImageConstraints() {
        cakeImageView.translatesAutoresizingMaskIntoConstraints = false
        cakeImageView.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        cakeImageView.leadingAnchor.constraint(equalTo: leadingAnchor, constant: 16).isActive = true
        cakeImageView.heightAnchor.constraint(equalToConstant: 120).isActive = true
        cakeImageView.widthAnchor.constraint(equalTo: cakeImageView.heightAnchor).isActive = true

    }

    // Cake Category
    func configureCakeCategory() {
        cakeCategory.numberOfLines = 0
        cakeCategory.adjustsFontSizeToFitWidth = true
    }

    func setCakeCategoryConstraints() {
        cakeCategory.translatesAutoresizingMaskIntoConstraints = false
        cakeCategory.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        cakeCategory.leadingAnchor.constraint(equalTo: cakeImageView.trailingAnchor, constant: 20).isActive = true
        cakeCategory.heightAnchor.constraint(equalToConstant: 80).isActive = true
        cakeCategory.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16).isActive = true    }

    // Cake Name
    func configureCakeName() {
        cakeName.numberOfLines = 0
        cakeName.adjustsFontSizeToFitWidth = true
    }

    func setCakeNameConstraints() {
        cakeName.translatesAutoresizingMaskIntoConstraints = false
        cakeName.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        cakeName.leadingAnchor.constraint(equalTo: cakeImageView.trailingAnchor, constant: 20).isActive = true
        cakeName.heightAnchor.constraint(equalToConstant: 80).isActive = true
        cakeName.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16).isActive = true
    }

    // Cake Size
    func configureCakeSize() {
        cakeSize.numberOfLines = 0
        cakeSize.adjustsFontSizeToFitWidth = true
    }

    func setCakeSizeConstraints() {
        cakeSize.translatesAutoresizingMaskIntoConstraints = false
        cakeSize.centerYAnchor.constraint(equalTo: centerYAnchor).isActive = true
        cakeSize.leadingAnchor.constraint(equalTo: cakeImageView.trailingAnchor, constant: 20).isActive = true
        cakeSize.heightAnchor.constraint(equalToConstant: 80).isActive = true
        cakeSize.trailingAnchor.constraint(equalTo: trailingAnchor, constant: -16).isActive = true

    }

}

The data should be shown, if I try to add more data to the table view, the row increase, but the data won't show


问:
how to use styled-icon on react-native?
`

```<code>import React from 'react'
import styled, { ThemeProvider } from "styled-components/native";
import { useDispatch, useSelector } from "react-redux"; // userDispatch = 데이터 변경시 사용 // useSelector = 데이터 가져올때 사용
import { darkTheme, lightTheme } from "../../../Theme";
import themeSlicer from "../../slicers/themeSlicer";
import Ionicons from "@expo/vector-icons/Ionicons";
import HeaderLogo from '../../../assets/header-logo.png'
import ICONS from '../../constants/icons'
import {Lock} from '@styled-icons/material' <<<<<<<<<<<<<<<<<<<<<<<this

const FeedList = ({ post }) => {
    const theme = useSelector((state) => state.themeSlicer.theme);
    const dispatch = useDispatch();
    return (
        <Container>
            <FeedHeader />
            <FeedBody />
        </Container>
    )
}

const FeedHeader = () => {
    return (
        <HeaderBox>
            <HeaderProfileBox>
                <TouchableOpacity>
                    <Avatar source={{uri: "https://i.ibb.co/ZhB1QPv/image.jpg"}} />
                </TouchableOpacity>
                <TouchableOpacity>
                    <Text>온석태</Text>
                </TouchableOpacity>
            </HeaderProfileBox>
            <View>
                <TouchableOpacity>
                    <Ionicons name="ellipsis-horizontal-outline" size={20} color="white"></Ionicons>
                </TouchableOpacity>
            </View>
        </HeaderBox>
    )
}

const FeedBody = () => {
    return (
        <View>
            <View>
            <Image source={{uri: "https://editsay.s3.ap-northeast-2.amazonaws.com/images/%EB%8C%80%EC%A7%80+1_1-100.jpg"}}/>
            </View>
            <FeedBodyBottom>
                <FeedBodyBottomIconsBox>
                    <TouchableOpacity>
                        <Ionicons name="ellipsis-horizontal-outline" size={20} color="white"></Ionicons>
                    </TouchableOpacity>
                    <TouchableOpacity>
                        <Ionicons name="ellipsis-horizontal-outline" size={20} color="white"></Ionicons>
                    </TouchableOpacity>
                    <TouchableOpacity>
                        <RedLock/> <<<<<<<<<<<<<<<<<<<<<<< this
                        <Ionicons name="ellipsis-horizontal-outline" size={20} color="white"></Ionicons>
                    </TouchableOpacity>
                </FeedBodyBottomIconsBox>
                <View></View>
                <View></View>
            </FeedBodyBottom>

        </View>
    )
}

const TouchableIcon  = ({name}) => {
    return (
        <TouchableOpacity>
            <Ionicons name={name} size={20} color="white"></Ionicons>
        </TouchableOpacity>
    )
}

export default FeedList

const RedLock = styled(Lock)`  <<<<<<<<<<<<<<<<<<<<<<<  this
  color: red;
`

const Avatar = styled.Image`
    width: 32px;
    height: 32px;
    border-radius: 50px;
    border-width: 2px;
    border-color: ${props => props.theme.TextColor};
    margin-right: 10px;
`;

const Text = styled.Text`
  color: ${props => props.theme.TextColor};
`;

const Image = styled.Image`
    width: 100%;
    height: 500px;
`;

const TouchableOpacity = styled.TouchableOpacity`

`;

const FeedBodyBottomIconsBox = styled.View`
    flex-direction: row;
`;
const FeedBodyBottom = styled.View`
    margin: 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
`;

const HeaderBox = styled.View`
    margin: 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
`;

const HeaderProfileBox = styled.View`
    flex-direction: row;
    align-items: center;
`;

const View = styled.View`

`;

const ScrollView = styled.ScrollView`

`;

const Container = styled.View`

`;
</code>```

`

This is my code and I am trying to write a Lock icon at the top
As it appears on the npm site, I downloaded yarn add @styled-icons/material and worked.
Even the components I created are capitalized. And also confirmed that removing this icon works properly again.
https://www.npmjs.com/package/styled-icons

I followed the npm site above and followed it, but

Invariant Violation: View config getter callback for component path must be a function (received undefined). Make sure to start component names with a capital letter.

This error pops up, I don't know what I did wrong

enter image description here

Title: how to use styled-icon on react-native?

Body:
`

import React from 'react'
import styled, { ThemeProvider } from "styled-components/native";
import { useDispatch, useSelector } from "react-redux"; // userDispatch = 데이터 변경시 사용 // useSelector = 데이터 가져올때 사용
import { darkTheme, lightTheme } from "../../../Theme";
import themeSlicer from "../../slicers/themeSlicer";
import Ionicons from "@expo/vector-icons/Ionicons";
import HeaderLogo from '../../../assets/header-logo.png'
import ICONS from '../../constants/icons'
import {Lock} from '@styled-icons/material' <<<<<<<<<<<<<<<<<<<<<<<this

const FeedList = ({ post }) => {
    const theme = useSelector((state) => state.themeSlicer.theme);
    const dispatch = useDispatch();
    return (
        <Container>
            <FeedHeader />
            <FeedBody />
        </Container>
    )
}

const FeedHeader = () => {
    return (
        <HeaderBox>
            <HeaderProfileBox>
                <TouchableOpacity>
                    <Avatar source={{uri: "https://i.ibb.co/ZhB1QPv/image.jpg"}} />
                </TouchableOpacity>
                <TouchableOpacity>
                    <Text>온석태</Text>
                </TouchableOpacity>
            </HeaderProfileBox>
            <View>
                <TouchableOpacity>
                    <Ionicons name="ellipsis-horizontal-outline" size={20} color="white"></Ionicons>
                </TouchableOpacity>
            </View>
        </HeaderBox>
    )
}

const FeedBody = () => {
    return (
        <View>
            <View>
            <Image source={{uri: "https://editsay.s3.ap-northeast-2.amazonaws.com/images/%EB%8C%80%EC%A7%80+1_1-100.jpg"}}/>
            </View>
            <FeedBodyBottom>
                <FeedBodyBottomIconsBox>
                    <TouchableOpacity>
                        <Ionicons name="ellipsis-horizontal-outline" size={20} color="white"></Ionicons>
                    </TouchableOpacity>
                    <TouchableOpacity>
                        <Ionicons name="ellipsis-horizontal-outline" size={20} color="white"></Ionicons>
                    </TouchableOpacity>
                    <TouchableOpacity>
                        <RedLock/> <<<<<<<<<<<<<<<<<<<<<<< this
                        <Ionicons name="ellipsis-horizontal-outline" size={20} color="white"></Ionicons>
                    </TouchableOpacity>
                </FeedBodyBottomIconsBox>
                <View></View>
                <View></View>
            </FeedBodyBottom>

        </View>
    )
}

const TouchableIcon  = ({name}) => {
    return (
        <TouchableOpacity>
            <Ionicons name={name} size={20} color="white"></Ionicons>
        </TouchableOpacity>
    )
}

export default FeedList

const RedLock = styled(Lock)`  <<<<<<<<<<<<<<<<<<<<<<<  this
  color: red;
`

const Avatar = styled.Image`
    width: 32px;
    height: 32px;
    border-radius: 50px;
    border-width: 2px;
    border-color: ${props => props.theme.TextColor};
    margin-right: 10px;
`;

const Text = styled.Text`
  color: ${props => props.theme.TextColor};
`;

const Image = styled.Image`
    width: 100%;
    height: 500px;
`;

const TouchableOpacity = styled.TouchableOpacity`

`;

const FeedBodyBottomIconsBox = styled.View`
    flex-direction: row;
`;
const FeedBodyBottom = styled.View`
    margin: 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
`;

const HeaderBox = styled.View`
    margin: 10px;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
`;

const HeaderProfileBox = styled.View`
    flex-direction: row;
    align-items: center;
`;

const View = styled.View`

`;

const ScrollView = styled.ScrollView`

`;

const Container = styled.View`

`;

`

This is my code and I am trying to write a Lock icon at the top
As it appears on the npm site, I downloaded yarn add @styled-icons/material and worked.
Even the components I created are capitalized. And also confirmed that removing this icon works properly again.
https://www.npmjs.com/package/styled-icons

I followed the npm site above and followed it, but

Invariant Violation: View config getter callback for component path must be a function (received undefined). Make sure to start component names with a capital letter.

This error pops up, I don't know what I did wrong

enter image description here


问:
how to solve this problem? Problem Arch LInx npm: error while loading shared libraries: libssl.so.1.1:?
When I try to start npm or enter any command, it throws me this error. How can I solve it? I tried to install openssl by yay and pacman but nothing installs and does not solve. Suggestions ??

Error : npm: error while loading shared libraries: libssl.so.1.1: cannot open shared object file: No such file or directory

I have arch linux

I tried installing in the openssl dependencies or the one that mentions the error but I couldn't find any I think I didn't find it