问:
Why TabbarView crash when swipe to next tabarView in flutter

on changing tabbarView I'm getting this error

package:scrollable_positioned_list/src/scrollable_positioned_list.dart':
Failed assertion: line 250 pos 12: '_scrollableListState == null': is
not true.

```<code>>  here is running code examlpe ..just call this class from main.dart
</code>```

use this package in yaml scrollable_positioned_list: ^0.2.3

I cant find any solution .. I dont have any idea why its crashing when I'm changing tabbar

```<code>class ExamleScreen extends StatefulWidget {
          final int  index;
          ExamleScreen({Key key,@required this.index}) : super(key: key);

          @override
          State<ExamleScreen> createState() => _CategoriesSubScreenState();
        }

        class _CategoriesSubScreenState extends State<ExamleScreen> with TickerProviderStateMixin {
               int currentIndex =0;
               TabController _tabController;
               ItemScrollController itemScrollController;
               ItemPositionsListener itemPositionsListener;
               int index = 0;

        // @override
        //   bool get wantKeepAlive => true;

          @override
            void initState() {
              super.initState();
              index = widget.index;

               itemPositionsListener = ItemPositionsListener.create();
               itemScrollController = ItemScrollController();
              WidgetsBinding.instance.addPostFrameCallback((_) {
                itemPositionsListener.itemPositions.addListener((){

                  final visibleIndex =itemPositionsListener.itemPositions.value;
                      currentIndex = visibleIndex.last.index;
                  print(visibleIndex.last.index);
                  setState(() {

                  });

                 });

              });

              _tabController = TabController(length: 10, vsync: this);
              _tabController.animateTo(widget.index);
              _tabController.addListener((){
                currentIndex = 0;
                print('my index is'+ _tabController.index.toString());
                index = _tabController.index;
               setState(() {});
              });

            }
          @override
              void dispose() {
                _tabController.dispose();

                super.dispose();
          }

          @override
          Widget build(BuildContext context) {
              //  super.build(context);
            return MaterialApp(
                  home: DefaultTabController(
                  length: 10,
                  child: Scaffold(
                    appBar: AppBar(
                      bottom: TabBar(
                        controller: _tabController,
                        labelColor: Colors.white,
                        unselectedLabelColor: Colors.grey,
                        labelStyle: const TextStyle(fontWeight: FontWeight.bold),
                        unselectedLabelStyle: const TextStyle(fontStyle: FontStyle.italic),
                        overlayColor: MaterialStateColor.resolveWith((Set<MaterialState> states) {
                          if (states.contains(MaterialState.pressed)) {
                            return Colors.blue;
                          } if (states.contains(MaterialState.focused)) {
                            return Colors.orange;
                          } else if (states.contains(MaterialState.hovered)) {
                            return Colors.pinkAccent;
                          }

                          return Colors.transparent;
                        }),
                        indicatorWeight: 3,
                        indicatorColor: Colors.white,
                        indicatorSize: TabBarIndicatorSize.label,
                        isScrollable: true,
                        physics: BouncingScrollPhysics(),
                        onTap: (int index) {
                          print('Tab $index is tapped');
                        },
                        enableFeedback: true,
                        tabs:  [
                         for (int  i =0 ;i< 10; i++ )
                               Tab(child:Text("Example name"))
                         ],
                      ),
                      title: Row(
                        children: [
                          Icon(Icons.arrow_back),
                          SizedBox(width: 12,),
                          const Text('Categories'),
                        ],
                      ),
                      backgroundColor: Colors.blue,
                    ),
                    body:
                     Column(
                      children: [
                      Container(
                            color: Colors.white,
                            height:50,
                            child:ListView.builder(
                                physics: ScrollPhysics(),
                              itemCount: 6,
                              shrinkWrap: true,
                              scrollDirection: Axis.horizontal,
                              itemBuilder: (context,index1){
                              return Container(child:  Padding(
                                padding: const EdgeInsets.all(8.0),
                                child: GestureDetector(
                                    onTap: ()async{
                                      scrollTo(index1);
                                      currentIndex = index1;
                                      setState(() {

                                      });
                                    },
                                    child: Container(
                                                    decoration: BoxDecoration(
                                                      color:currentIndex == index1 ? Colors.blue:Colors.white,
                                                      borderRadius: BorderRadius.circular(20)),
                                                    child: Padding(
                                                      padding: const EdgeInsets.all(8.0),
                                                      child: Center(child:  Text("sub Category name",style: TextStyle(color:currentIndex == index1 ?Colors.white:Colors.black,),
                                                     )
                                                    ),
                                                   )
                                                  ),
                                  ),
                              )
                              );
                            }) ),

                      Expanded(
                          child: TabBarView(
                            controller: _tabController,
                            physics: BouncingScrollPhysics(),
                            children: [
                                   for (int i = 0; i< 10; i++ )

                                       ScrollablePositionedList.builder(
                                                itemScrollController: itemScrollController,
                                                itemPositionsListener: itemPositionsListener,
                                                itemCount:6,
                                                itemBuilder: (BuildContext context, int index) {
                                                      return  Column(
                                                            crossAxisAlignment: CrossAxisAlignment.start,
                                                            children: [

                                                              Padding(
                                                               padding: EdgeInsets.only(left:16,right: 16,top:4,bottom:4),
                                                                child: Container(
                                                                    width: 170,
                                                                    child: Text(
                                                                      "sub Category name",
                                                                      overflow: TextOverflow.ellipsis,
                                                                      maxLines: 2,
                                                                      style: TextStyle(
                                                                        fontWeight: FontWeight.w600,
                                                                        color:Colors.black,
                                                                      ),
                                                                    ),
                                                                  ),
                                                              ),
                                                              ListView.builder(
                                                                  shrinkWrap: true,
                                                                  physics:ScrollPhysics(),
                                                                  itemCount: 4,
                                                                  scrollDirection: Axis.vertical,
                                                                  itemBuilder: (context, index2) {
                                                                            return GestureDetector(
                                                                              onTap: (){},
                                                                              child: CategoryItemWidget());
                                                                }
                                                              )
                                                              ]
                                                         );

                                                },
                                              )

                               ]
                          ),
                        ),

                      ],

                    )
                  ),
                ),
              );
          }
          void scrollTo(int index){
                  WidgetsBinding.instance.addPostFrameCallback((_) {
            if(itemScrollController.isAttached){
              itemScrollController.scrollTo(
              index: index,
              duration: Duration(seconds: 1),
              curve: Curves.easeInOutCubic,
              );

            }
                  });
          }
        }

        class CategoryItemWidget extends StatelessWidget {
          const CategoryItemWidget({Key key}) : super(key: key);

          @override
          Widget build(BuildContext context) {
            return Padding(
                      padding: EdgeInsets.only(left:16,right: 16,top:4,bottom:4),
                      child: GestureDetector(
                        onTap: () {},
                        child: Container(
                          height: 150,
                          width: 300,
                          decoration: BoxDecoration(
                              boxShadow: [
                                BoxShadow(
                                  color: Colors.grey.withOpacity(0.3),
                                  spreadRadius: 1,
                                  blurRadius: 3,
                                  offset: Offset(0, 3), // changes position of shadow
                                ),
                              ],
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(20)),
                          child: Stack(
                            children: [
                              // Column(
                              //   children: [
                              Padding(
                                padding: const EdgeInsets.only(top: 8),
                                child: Row(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  children: [
                                    Padding(
                                      padding: const EdgeInsets.all(8.0),
                                      child: Image.network(
                                          "https://pbs.twimg.com/media/FUQmCz6XoAINzeQ.jpg:large",
                                          height: 120,
                                          fit: BoxFit.contain,
                                          width: 130),
                                    ),
                                    Column(
                                      crossAxisAlignment: CrossAxisAlignment.start,
                                      children: [
                                        Padding(
                                          padding: const EdgeInsets.only(left: 8.0),
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Container(
                                                width: 170,
                                                child: Text(
                                                  "Peak Frech Biscuits with choclate",
                                                  overflow: TextOverflow.ellipsis,
                                                  maxLines: 2,
                                                  style: TextStyle(
                                                    color: Colors.black,
                                                  ),
                                                ),
                                              ),

                                            ],
                                          ),
                                        ),
                                        Padding(
                                          padding: const EdgeInsets.all(8.0),
                                          child: Text(
                                            "Rs 40",
                                            style: TextStyle(
                                              fontWeight: FontWeight.w600,
                                              color: Colors.black,
                                            ),
                                          ),
                                        ),
                                      ],
                                    ),
                                  ],
                                ),
                              ),
                              //   ],
                              // ),
                              Positioned(
                                bottom: 10,
                                right: 6,
                                child: Container(
                                  height: 30,
                                  width: 120,
                                  decoration: BoxDecoration(
                                      borderRadius: BorderRadius.circular(20),
                                      color: Colors.blue,),
                                  child: Row(
                                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                                    children: [
                                      Icon(Icons.horizontal_rule_rounded,color: Colors.white),
                                      Text(
                                        "1",
                                        style: TextStyle(
                                            fontWeight: FontWeight.w700,
                                            fontSize: 18,
                                            color: Colors.white),
                                      ),
                                      Icon(Icons.add, color: Colors.white),
                                    ],
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                    );
          }
        }
</code>```

Body:
on changing tabbarView I'm getting this error

package:scrollable_positioned_list/src/scrollable_positioned_list.dart':
Failed assertion: line 250 pos 12: '_scrollableListState == null': is
not true.

>  here is running code examlpe ..just call this class from main.dart

use this package in yaml scrollable_positioned_list: ^0.2.3

I cant find any solution .. I dont have any idea why its crashing when I'm changing tabbar

class ExamleScreen extends StatefulWidget {
          final int  index;
          ExamleScreen({Key key,@required this.index}) : super(key: key);

          @override
          State<ExamleScreen> createState() => _CategoriesSubScreenState();
        }

        class _CategoriesSubScreenState extends State<ExamleScreen> with TickerProviderStateMixin {
               int currentIndex =0;
               TabController _tabController;
               ItemScrollController itemScrollController;
               ItemPositionsListener itemPositionsListener;
               int index = 0;

        // @override
        //   bool get wantKeepAlive => true;

          @override
            void initState() {
              super.initState();
              index = widget.index;

               itemPositionsListener = ItemPositionsListener.create();
               itemScrollController = ItemScrollController();
              WidgetsBinding.instance.addPostFrameCallback((_) {
                itemPositionsListener.itemPositions.addListener((){

                  final visibleIndex =itemPositionsListener.itemPositions.value;
                      currentIndex = visibleIndex.last.index;
                  print(visibleIndex.last.index);
                  setState(() {

                  });

                 });

              });

              _tabController = TabController(length: 10, vsync: this);
              _tabController.animateTo(widget.index);
              _tabController.addListener((){
                currentIndex = 0;
                print('my index is'+ _tabController.index.toString());
                index = _tabController.index;
               setState(() {});
              });

            }
          @override
              void dispose() {
                _tabController.dispose();

                super.dispose();
          }

          @override
          Widget build(BuildContext context) {
              //  super.build(context);
            return MaterialApp(
                  home: DefaultTabController(
                  length: 10,
                  child: Scaffold(
                    appBar: AppBar(
                      bottom: TabBar(
                        controller: _tabController,
                        labelColor: Colors.white,
                        unselectedLabelColor: Colors.grey,
                        labelStyle: const TextStyle(fontWeight: FontWeight.bold),
                        unselectedLabelStyle: const TextStyle(fontStyle: FontStyle.italic),
                        overlayColor: MaterialStateColor.resolveWith((Set<MaterialState> states) {
                          if (states.contains(MaterialState.pressed)) {
                            return Colors.blue;
                          } if (states.contains(MaterialState.focused)) {
                            return Colors.orange;
                          } else if (states.contains(MaterialState.hovered)) {
                            return Colors.pinkAccent;
                          }

                          return Colors.transparent;
                        }),
                        indicatorWeight: 3,
                        indicatorColor: Colors.white,
                        indicatorSize: TabBarIndicatorSize.label,
                        isScrollable: true,
                        physics: BouncingScrollPhysics(),
                        onTap: (int index) {
                          print('Tab $index is tapped');
                        },
                        enableFeedback: true,
                        tabs:  [
                         for (int  i =0 ;i< 10; i++ )
                               Tab(child:Text("Example name"))
                         ],
                      ),
                      title: Row(
                        children: [
                          Icon(Icons.arrow_back),
                          SizedBox(width: 12,),
                          const Text('Categories'),
                        ],
                      ),
                      backgroundColor: Colors.blue,
                    ),
                    body:
                     Column(
                      children: [
                      Container(
                            color: Colors.white,
                            height:50,
                            child:ListView.builder(
                                physics: ScrollPhysics(),
                              itemCount: 6,
                              shrinkWrap: true,
                              scrollDirection: Axis.horizontal,
                              itemBuilder: (context,index1){
                              return Container(child:  Padding(
                                padding: const EdgeInsets.all(8.0),
                                child: GestureDetector(
                                    onTap: ()async{
                                      scrollTo(index1);
                                      currentIndex = index1;
                                      setState(() {

                                      });
                                    },
                                    child: Container(
                                                    decoration: BoxDecoration(
                                                      color:currentIndex == index1 ? Colors.blue:Colors.white,
                                                      borderRadius: BorderRadius.circular(20)),
                                                    child: Padding(
                                                      padding: const EdgeInsets.all(8.0),
                                                      child: Center(child:  Text("sub Category name",style: TextStyle(color:currentIndex == index1 ?Colors.white:Colors.black,),
                                                     )
                                                    ),
                                                   )
                                                  ),
                                  ),
                              )
                              );
                            }) ),

                      Expanded(
                          child: TabBarView(
                            controller: _tabController,
                            physics: BouncingScrollPhysics(),
                            children: [
                                   for (int i = 0; i< 10; i++ )

                                       ScrollablePositionedList.builder(
                                                itemScrollController: itemScrollController,
                                                itemPositionsListener: itemPositionsListener,
                                                itemCount:6,
                                                itemBuilder: (BuildContext context, int index) {
                                                      return  Column(
                                                            crossAxisAlignment: CrossAxisAlignment.start,
                                                            children: [

                                                              Padding(
                                                               padding: EdgeInsets.only(left:16,right: 16,top:4,bottom:4),
                                                                child: Container(
                                                                    width: 170,
                                                                    child: Text(
                                                                      "sub Category name",
                                                                      overflow: TextOverflow.ellipsis,
                                                                      maxLines: 2,
                                                                      style: TextStyle(
                                                                        fontWeight: FontWeight.w600,
                                                                        color:Colors.black,
                                                                      ),
                                                                    ),
                                                                  ),
                                                              ),
                                                              ListView.builder(
                                                                  shrinkWrap: true,
                                                                  physics:ScrollPhysics(),
                                                                  itemCount: 4,
                                                                  scrollDirection: Axis.vertical,
                                                                  itemBuilder: (context, index2) {
                                                                            return GestureDetector(
                                                                              onTap: (){},
                                                                              child: CategoryItemWidget());
                                                                }
                                                              )
                                                              ]
                                                         );

                                                },
                                              )

                               ]
                          ),
                        ),

                      ],

                    )
                  ),
                ),
              );
          }
          void scrollTo(int index){
                  WidgetsBinding.instance.addPostFrameCallback((_) {
            if(itemScrollController.isAttached){
              itemScrollController.scrollTo(
              index: index,
              duration: Duration(seconds: 1),
              curve: Curves.easeInOutCubic,
              );

            }
                  });
          }
        }

        class CategoryItemWidget extends StatelessWidget {
          const CategoryItemWidget({Key key}) : super(key: key);

          @override
          Widget build(BuildContext context) {
            return Padding(
                      padding: EdgeInsets.only(left:16,right: 16,top:4,bottom:4),
                      child: GestureDetector(
                        onTap: () {},
                        child: Container(
                          height: 150,
                          width: 300,
                          decoration: BoxDecoration(
                              boxShadow: [
                                BoxShadow(
                                  color: Colors.grey.withOpacity(0.3),
                                  spreadRadius: 1,
                                  blurRadius: 3,
                                  offset: Offset(0, 3), // changes position of shadow
                                ),
                              ],
                              color: Colors.white,
                              borderRadius: BorderRadius.circular(20)),
                          child: Stack(
                            children: [
                              // Column(
                              //   children: [
                              Padding(
                                padding: const EdgeInsets.only(top: 8),
                                child: Row(
                                  crossAxisAlignment: CrossAxisAlignment.start,
                                  mainAxisAlignment: MainAxisAlignment.start,
                                  children: [
                                    Padding(
                                      padding: const EdgeInsets.all(8.0),
                                      child: Image.network(
                                          "https://pbs.twimg.com/media/FUQmCz6XoAINzeQ.jpg:large",
                                          height: 120,
                                          fit: BoxFit.contain,
                                          width: 130),
                                    ),
                                    Column(
                                      crossAxisAlignment: CrossAxisAlignment.start,
                                      children: [
                                        Padding(
                                          padding: const EdgeInsets.only(left: 8.0),
                                          child: Row(
                                            mainAxisAlignment:
                                                MainAxisAlignment.spaceBetween,
                                            children: [
                                              Container(
                                                width: 170,
                                                child: Text(
                                                  "Peak Frech Biscuits with choclate",
                                                  overflow: TextOverflow.ellipsis,
                                                  maxLines: 2,
                                                  style: TextStyle(
                                                    color: Colors.black,
                                                  ),
                                                ),
                                              ),

                                            ],
                                          ),
                                        ),
                                        Padding(
                                          padding: const EdgeInsets.all(8.0),
                                          child: Text(
                                            "Rs 40",
                                            style: TextStyle(
                                              fontWeight: FontWeight.w600,
                                              color: Colors.black,
                                            ),
                                          ),
                                        ),
                                      ],
                                    ),
                                  ],
                                ),
                              ),
                              //   ],
                              // ),
                              Positioned(
                                bottom: 10,
                                right: 6,
                                child: Container(
                                  height: 30,
                                  width: 120,
                                  decoration: BoxDecoration(
                                      borderRadius: BorderRadius.circular(20),
                                      color: Colors.blue,),
                                  child: Row(
                                    mainAxisAlignment: MainAxisAlignment.spaceAround,
                                    children: [
                                      Icon(Icons.horizontal_rule_rounded,color: Colors.white),
                                      Text(
                                        "1",
                                        style: TextStyle(
                                            fontWeight: FontWeight.w700,
                                            fontSize: 18,
                                            color: Colors.white),
                                      ),
                                      Icon(Icons.add, color: Colors.white),
                                    ],
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                    );
          }
        }


来源: stackexchange

问:
Adding react-native-vector-icons in web.config.js ( babel Loader Configuration)
After adding path.resolve(appDirectory, 'node_modules/react-native-vector-icons')
I got this error

Click the image link

My expectation is a successful build of the "react-native-vector-icons" module.

ContentLicense: CC BY-SA 4.0


问:
How to fix Request Timed Out error in facebook graph?
when me try to execute this request to receive correspondence, an error occurs.

https://graph.facebook.com/v15.0/page-id/conversations?platform=instagram&fields=messages,id&access_token=tokenPage

{ "error": { "message": "Timeout", "type": "OAuthException", "code": -2, "error_subcode": 2534084, "is_transient": false, "error_user_title": "Request Timed Out", "error_user_msg": "Your query has timed out since you have too many conversations with users who do not have a role on app. Please request for advanced access to instagram_manage_messages permission or reduce the number of existing threads on your IG Business with users with no role on the app.", } }

I can’t understand, the permissions were almost all -

public_profile,ads_management,instagram_basic,instagram_manage_messages,instagram_manage_comments,instagram_manage_messages,pages_manage_ads,pages_read_user_content,pages_messaging,user_photos,leads_retrieval,ads_read,ads_management

what could be wrong?


问:
How to re move "This accessibility bypass should be removed." by using Reflect
I have done the below code

```<code>public static <T> T mergeObjects(T draft, T existing)
      throws IllegalAccessException, InstantiationException, NoSuchMethodException,
          InvocationTargetException {
    Class<?> clazz = draft.getClass();
    Field[] fields = clazz.getDeclaredFields();
    Object returnValue = clazz.getDeclaredConstructor().newInstance();
    for (Field field : fields) {
      field.setAccessible(true);
      Object draftValue = field.get(draft);
      Object existingValue = field.get(existing);
      if (Objects.equals(existingValue, draftValue)) field.set(returnValue, existingValue);
      else field.set(returnValue, draftValue);
    }
    return (T) returnValue;
  }
</code>```

but it's giving the sonar lint issue for setter at

field.setAccessible(true);

if (Objects.equals(existingValue, draftValue)) field.set(returnValue, existingValue);

else field.set(returnValue, draftValue);

I have tried many things but not working.
Can anyone know hoe to resolve it, please tell me.

Body:
I have done the below code

public static <T> T mergeObjects(T draft, T existing)
      throws IllegalAccessException, InstantiationException, NoSuchMethodException,
          InvocationTargetException {
    Class<?> clazz = draft.getClass();
    Field[] fields = clazz.getDeclaredFields();
    Object returnValue = clazz.getDeclaredConstructor().newInstance();
    for (Field field : fields) {
      field.setAccessible(true);
      Object draftValue = field.get(draft);
      Object existingValue = field.get(existing);
      if (Objects.equals(existingValue, draftValue)) field.set(returnValue, existingValue);
      else field.set(returnValue, draftValue);
    }
    return (T) returnValue;
  }

but it's giving the sonar lint issue for setter at

field.setAccessible(true);

if (Objects.equals(existingValue, draftValue)) field.set(returnValue, existingValue);

else field.set(returnValue, draftValue);

I have tried many things but not working.
Can anyone know hoe to resolve it, please tell me.


问:
ffmpeg stream to youtube has no sound with bigger mp4 file
I want to stream to Youtube from a Ubuntu VPS and it works, but when i set a bigger .mp4 file (220mb) the livestream on Youtube has no sound.

I tried to split the .mp4 file to 5s parts and concat them but without success.

My settings are:

```<code>FPS="30"                                       # FPS de la vidéo en sortie
QUAL="superfast"                                  # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"  # URL de base RTMP youtube

              # Source UDP (voir les annonces SAP)
KEY="###-my-key-###"                                     # Clé à récupérer sur>
VSOURCE="parts/files.txt"
ASOURCE="1m.mp3"

ffmpeg \
    -stream_loop -1 -f concat -i "$VSOURCE" -deinterlace \
    -stream_loop  -1 -i "$ASOURCE" \
    -vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
    -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \
    -f flv "$YOUTUBE_URL/$KEY"
</code>```

Hope someone can help me :)

I tried to split the .mp4 file to 5s parts and concat them but without success.

Body:
I want to stream to Youtube from a Ubuntu VPS and it works, but when i set a bigger .mp4 file (220mb) the livestream on Youtube has no sound.

I tried to split the .mp4 file to 5s parts and concat them but without success.

My settings are:

FPS="30"                                       # FPS de la vidéo en sortie
QUAL="superfast"                                  # Preset de qualité FFMPEG
YOUTUBE_URL="rtmp://a.rtmp.youtube.com/live2"  # URL de base RTMP youtube

              # Source UDP (voir les annonces SAP)
KEY="###-my-key-###"                                     # Clé à récupérer sur>
VSOURCE="parts/files.txt"
ASOURCE="1m.mp3"

ffmpeg \
    -stream_loop -1 -f concat -i "$VSOURCE" -deinterlace \
    -stream_loop  -1 -i "$ASOURCE" \
    -vcodec libx264 -pix_fmt yuv420p -preset $QUAL -r $FPS -g $(($FPS * 2)) -b:v $VBR \
    -acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k \
    -f flv "$YOUTUBE_URL/$KEY"

Hope someone can help me :)

I tried to split the .mp4 file to 5s parts and concat them but without success.


问:
Problem while scheduling local notification in flutter
When I schedule local notification on my phone(android version - 7) the app is crashed and when I schedule same for android version - 8 or above it works perfectly In flutter

minSdkVersion 21
compileSdkVersion 33
targetSdkVersion flutter.targetSdkVersion

flutter_local_notifications: ^12.0.4


问:
What are the different ways to check the definition of annotation in any framework using Intellij
I wanted to check the implementation of some annotation in spring, let us say Transactional.
Is there any way to find the defining class where what should happen when an annotation is used, is written?

Based on some experience and reading docs, I know where its implementation is written but I wanted to know any shortcuts or any thought process which can directly take me to that defining class of annotation in the case of Spring AOP mostly.

I am using Intellij Idea with Java.


问:
Plotly sunburst graph not showing
Im currently doing a project,and created a sunburst graph using the following codes

```<code>from plotly.subplots import make_subplots
import plotly.express as px
import plotly.graph_objects as go
from plotly.offline import iplot, init_notebook_mode
from plotly.subplots import make_subplots

fig10=px.sunburst(df,path=["dep","edu","perfo"], color="perfo")
fig10.update_layout(title='Location and Sales_Agent',title_x=0.5)
fig10.update_traces(textinfo="label+percent parent")
</code>```

When i try re-open the jupiter notebook, this graph is not showing??`

any solution for this issue??`

Title: Plotly sunburst graph not showing

Body:
Im currently doing a project,and created a sunburst graph using the following codes

from plotly.subplots import make_subplots
import plotly.express as px
import plotly.graph_objects as go
from plotly.offline import iplot, init_notebook_mode
from plotly.subplots import make_subplots

fig10=px.sunburst(df,path=["dep","edu","perfo"], color="perfo")
fig10.update_layout(title='Location and Sales_Agent',title_x=0.5)
fig10.update_traces(textinfo="label+percent parent")

When i try re-open the jupiter notebook, this graph is not showing??`

any solution for this issue??`


问:
I get a member not found error using a mapFrom function in dart to query Firestore
I want to use dart to query Firestore for documents where the list field in the record matches two document references as elements.

However, I get this fromMap error:

```<code>Error: Member not found: 'ChatsRecord.fromMap'.
    ChatsRecord chatDoc = ChatsRecord.fromMap(doc.data());
                                      ^^^^^^^
</code>```

Here is my code:

import 'package:cloud_firestore/cloud_firestore.dart';

Future<List<ChatsRecord>> getChatDoc(
  DocumentReference chatUserRef,
  DocumentReference authUserRef,
) async {
  // Add your function code here!

  final firestore =
      FirebaseFirestore.instance; // Get a reference to the Firestore database
  final collectionRef =
      firestore.collection('chats'); // Get a reference to the collection
  final filteredDocuments = collectionRef.where('users', isEqualTo: [
    authUserRef,
    chatUserRef
  ]); // Use the `where` method to filter the list of documents

  final queryDocuments = await filteredDocuments
      .get(); // You can then use the get method on this Query object to retrieve the list of documents.

  List<ChatsRecord> listChatDocs = [];

  for (DocumentSnapshot doc in queryDocuments.docs) {
    final chatDoc = ChatsRecord.fromMap(doc.data());
    listChatDocs.add(chatDoc); // add chatDoc

  }

  return listChatDocs;
}
```

Body:
I want to use dart to query Firestore for documents where the list field in the record matches two document references as elements.

However, I get this fromMap error:

Error: Member not found: 'ChatsRecord.fromMap'.
    ChatsRecord chatDoc = ChatsRecord.fromMap(doc.data());
                                      ^^^^^^^

Here is my code:

import 'package:cloud_firestore/cloud_firestore.dart';

Future<List<ChatsRecord>> getChatDoc(
  DocumentReference chatUserRef,
  DocumentReference authUserRef,
) async {
  // Add your function code here!

  final firestore =
      FirebaseFirestore.instance; // Get a reference to the Firestore database
  final collectionRef =
      firestore.collection('chats'); // Get a reference to the collection
  final filteredDocuments = collectionRef.where('users', isEqualTo: [
    authUserRef,
    chatUserRef
  ]); // Use the `where` method to filter the list of documents

  final queryDocuments = await filteredDocuments
      .get(); // You can then use the get method on this Query object to retrieve the list of documents.

  List<ChatsRecord> listChatDocs = [];

  for (DocumentSnapshot doc in queryDocuments.docs) {
    final chatDoc = ChatsRecord.fromMap(doc.data());
    listChatDocs.add(chatDoc); // add chatDoc

  }

  return listChatDocs;
}


问:
I have error Name of field or property being initialized in an object initializer must start with '.'
I am building an XML file and when add this part of AllowanceCharge it gives me this error Name of field or property being initialized in an object initializer must start with '.'. and all the names start with period! what could be the issue here?

My code is:

```<code>         .AllowanceCharge = New List(Of AllowanceChargeType) From
                {
                    New AllowanceChargeType With
                    {
                        .ChargeIndicator = False,
                        .AllowanceChargeReason = New List(Of TextType) From
                        {
                            New TextType With
                            {
                                .Value = "discount"
                            }
                        },
                        .Amount = New AmountType With
                        {
                            .currencyID = "SAR",
                            .Value = 100
                        },
                        .TaxCategory = New TaxCategoryType With {
                            .ID = New IdentifierType With {
                            .Value = "S"
                            },
                            .Percent = 15.0,
                            .TaxScheme = New TaxSchemeType With {
                            .ID = "VAT"
                            },
                        }
                    }
                },
</code>```

The issue come when I added this part:

```<code>                        .TaxCategory = New TaxCategoryType With {
                           .ID = New IdentifierType With {
                           .Value = "S"
                           },
                           .Percent = 20,
                           .TaxScheme = New TaxSchemeType With {
                           .ID = "VAT"
                            },
                        }
</code>```

Body:
I am building an XML file and when add this part of AllowanceCharge it gives me this error Name of field or property being initialized in an object initializer must start with '.'. and all the names start with period! what could be the issue here?

My code is:

         .AllowanceCharge = New List(Of AllowanceChargeType) From
                {
                    New AllowanceChargeType With
                    {
                        .ChargeIndicator = False,
                        .AllowanceChargeReason = New List(Of TextType) From
                        {
                            New TextType With
                            {
                                .Value = "discount"
                            }
                        },
                        .Amount = New AmountType With
                        {
                            .currencyID = "SAR",
                            .Value = 100
                        },
                        .TaxCategory = New TaxCategoryType With {
                            .ID = New IdentifierType With {
                            .Value = "S"
                            },
                            .Percent = 15.0,
                            .TaxScheme = New TaxSchemeType With {
                            .ID = "VAT"
                            },
                        }
                    }
                },

The issue come when I added this part:

                        .TaxCategory = New TaxCategoryType With {
                           .ID = New IdentifierType With {
                           .Value = "S"
                           },
                           .Percent = 20,
                           .TaxScheme = New TaxSchemeType With {
                           .ID = "VAT"
                            },
                        }


问:
Click event of a button is not running outside a loop in javascript
I am writing a website program to create teams randomly from the input provided. Initially the user need to provide the number of players that needs to be teamed and it should be a even number. After that the user needs to provide all the players names for the names to be sorted as teams. The second part of the program(after providing the names) will only work within the IF loop of the first section, but it wont work outside the IF loop.

```<code>let inputNumber = "";
        let i = 0;
        let players = new Array();
        let random = "";
        let j = "";

        $("#button").click(function()
        {
            inputNumber = $('#number_input').val();

            // console.log('the input number provided is: ' + inputNumber);
            if (inputNumber >= "1" && (inputNumber % 2) == 0)
            {
                $('#form').addClass('no_display');
                $('#form').removeClass('display');
                $('#list').addClass('display');
                $('#list').removeClass('no_display');

                for (i = 0; i < inputNumber; i++)
                {
                    $('#list-form').append(' <div class="input-group"><input required type="text"class="form-control playerNames" placeholder="Enter Player Name" id="'+i+'"></div>');
                }
                $('#list-form').append('<div class="d-flex justify-content-center"><button class="btn btn-primary" type="button" id="listSubmit" >Submit</button></div>');

                // console.log($('#list').html());

                // alert('given number is even')
                $('#listSubmit').click(function()
                    {
                        alert('button1 is clicked');
                        $("input.playerNames").each(function()
                        {
                            // console.log("The id of the current input is: " + $(this).val());
                            players.push($(this).val());
                        })
                        // console.log('the players includes ouptput is: '+players.includes("",0));
                        // console.log(players);

                        let temp = players.includes("",0);
                        i = 0;
                        if(temp == true)
                        {
                            players.splice(0, players.length);
                            $('#dangerAlert').removeClass('no_display').addClass('display');
                        }
                        else
                        {
                            $('#dangerAlert').removeClass('display').addClass('no_display');
                            while (players.length != 0)
                            {
                                // i=0;
                                let arrayExtract = new Array();

                                for(let j = 0; j< 2; j++)
                                {
                                    random = Math.floor(Math.random() * players.length)
                                    // console.log('the generated random number is: '+ random);
                                    arrayExtract.push(players[random]);

                                    players.splice(random, 1);
                                }
                                // console.log(arrayExtract);
                                i = i+1;
                                $("#teamsDiv").append('<div class= "container teams"><p class="text-center fs-3 fw-bold text-decoration-underline">Team' + i+ '</p> <p class="text-center fs-4">'
                                +arrayExtract[0]+', '+ arrayExtract[1] + '</P> </div>');
                                arrayExtract.splice(0, arrayExtract.length);
                            }
                            $('#list').removeClass('display');
                            $('#list').addClass('no_display');
                        }
                    })
            }
            else if((inputNumber % 2) != 0)
            {
                alert('Please enter a even number');
                $('#number_input').val('');
            }
            else if(inputNumber < "1")
            {
                alert('Please provide a number to continue');
            }
        }
        )
</code>```

the above code works fine. but if i move the LISTSUBMIT click event outside of the if loops, it isn't working.

```<code> $("#button").click(function()
        {
            inputNumber = $('#number_input').val();

            // console.log('the input number provided is: ' + inputNumber);
            if (inputNumber >= "1" && (inputNumber % 2) == 0)
            {
                $('#form').addClass('no_display');
                $('#form').removeClass('display');
                $('#list').addClass('display');
                $('#list').removeClass('no_display');

                for (i = 0; i < inputNumber; i++)
                {
                    $('#list-form').append(' <div class="input-group"><input required type="text"class="form-control playerNames" placeholder="Enter Player Name" id="'+i+'"></div>');
                }
                $('#list-form').append('<div class="d-flex justify-content-center"><button class="btn btn-primary" type="button" id="listSubmit" >Submit</button></div>');

                // console.log($('#list').html());

                // alert('given number is even')

            }
            else if((inputNumber % 2) != 0)
            {
                alert('Please enter a even number');
                $('#number_input').val('');
            }
            else if(inputNumber < "1")
            {
                alert('Please provide a number to continue');
            }
        }
        )
        $('#listSubmit').click(function()
                    {
                        alert('button1 is clicked');
                        $("input.playerNames").each(function()
                        {
                            // console.log("The id of the current input is: " + $(this).val());
                            players.push($(this).val());
                        })
                        // console.log('the players includes ouptput is: '+players.includes("",0));
                        // console.log(players);

                        let temp = players.includes("",0);
                        i = 0;
                        if(temp == true)
                        {
                            players.splice(0, players.length);
                            $('#dangerAlert').removeClass('no_display').addClass('display');
                        }
                        else
                        {
                            $('#dangerAlert').removeClass('display').addClass('no_display');
                            while (players.length != 0)
                            {
                                // i=0;
                                let arrayExtract = new Array();

                                for(let j = 0; j< 2; j++)
                                {
                                    random = Math.floor(Math.random() * players.length)
                                    // console.log('the generated random number is: '+ random);
                                    arrayExtract.push(players[random]);

                                    players.splice(random, 1);
                                }
                                // console.log(arrayExtract);
                                i = i+1;
                                $("#teamsDiv").append('<div class= "container teams"><p class="text-center fs-3 fw-bold text-decoration-underline">Team' + i+ '</p> <p class="text-center fs-4">'
                                +arrayExtract[0]+', '+ arrayExtract[1] + '</P> </div>');
                                arrayExtract.splice(0, arrayExtract.length);
                            }
                            $('#list').removeClass('display');
                            $('#list').addClass('no_display');
                        }
                    })
</code>```

the above code is not working.

i want know why the listSubmit click event code is not working if the code is outside the loop of first section.

Body:
I am writing a website program to create teams randomly from the input provided. Initially the user need to provide the number of players that needs to be teamed and it should be a even number. After that the user needs to provide all the players names for the names to be sorted as teams. The second part of the program(after providing the names) will only work within the IF loop of the first section, but it wont work outside the IF loop.

let inputNumber = "";
        let i = 0;
        let players = new Array();
        let random = "";
        let j = "";

        $("#button").click(function()
        {
            inputNumber = $('#number_input').val();

            // console.log('the input number provided is: ' + inputNumber);
            if (inputNumber >= "1" && (inputNumber % 2) == 0)
            {
                $('#form').addClass('no_display');
                $('#form').removeClass('display');
                $('#list').addClass('display');
                $('#list').removeClass('no_display');

                for (i = 0; i < inputNumber; i++)
                {
                    $('#list-form').append('
<input required type="text"class="form-control playerNames" placeholder="Enter Player Name" id="'+i+'">
');
                }
                $('#list-form').append('
<button class="btn btn-primary" type="button" id="listSubmit" >Submit</button>
');

                // console.log($('#list').html());

                // alert('given number is even')
                $('#listSubmit').click(function()
                    {
                        alert('button1 is clicked');
                        $("input.playerNames").each(function()
                        {
                            // console.log("The id of the current input is: " + $(this).val());
                            players.push($(this).val());
                        })
                        // console.log('the players includes ouptput is: '+players.includes("",0));
                        // console.log(players);

                        let temp = players.includes("",0);
                        i = 0;
                        if(temp == true)
                        {
                            players.splice(0, players.length);
                            $('#dangerAlert').removeClass('no_display').addClass('display');
                        }
                        else
                        {
                            $('#dangerAlert').removeClass('display').addClass('no_display');
                            while (players.length != 0)
                            {
                                // i=0;
                                let arrayExtract = new Array();

                                for(let j = 0; j< 2; j++)
                                {
                                    random = Math.floor(Math.random() * players.length)
                                    // console.log('the generated random number is: '+ random);
                                    arrayExtract.push(players[random]);

                                    players.splice(random, 1);
                                }
                                // console.log(arrayExtract);
                                i = i+1;
                                $("#teamsDiv").append('

Team' + i+ '

'
                                +arrayExtract[0]+', '+ arrayExtract[1] + '

');
                                arrayExtract.splice(0, arrayExtract.length);
                            }
                            $('#list').removeClass('display');
                            $('#list').addClass('no_display');
                        }
                    })
            }
            else if((inputNumber % 2) != 0)
            {
                alert('Please enter a even number');
                $('#number_input').val('');
            }
            else if(inputNumber < "1")
            {
                alert('Please provide a number to continue');
            }
        }
        )

the above code works fine. but if i move the LISTSUBMIT click event outside of the if loops, it isn't working.

 $("#button").click(function()
        {
            inputNumber = $('#number_input').val();

            // console.log('the input number provided is: ' + inputNumber);
            if (inputNumber >= "1" && (inputNumber % 2) == 0)
            {
                $('#form').addClass('no_display');
                $('#form').removeClass('display');
                $('#list').addClass('display');
                $('#list').removeClass('no_display');

                for (i = 0; i < inputNumber; i++)
                {
                    $('#list-form').append('
<input required type="text"class="form-control playerNames" placeholder="Enter Player Name" id="'+i+'">
');
                }
                $('#list-form').append('
<button class="btn btn-primary" type="button" id="listSubmit" >Submit</button>
');

                // console.log($('#list').html());

                // alert('given number is even')

            }
            else if((inputNumber % 2) != 0)
            {
                alert('Please enter a even number');
                $('#number_input').val('');
            }
            else if(inputNumber < "1")
            {
                alert('Please provide a number to continue');
            }
        }
        )
        $('#listSubmit').click(function()
                    {
                        alert('button1 is clicked');
                        $("input.playerNames").each(function()
                        {
                            // console.log("The id of the current input is: " + $(this).val());
                            players.push($(this).val());
                        })
                        // console.log('the players includes ouptput is: '+players.includes("",0));
                        // console.log(players);

                        let temp = players.includes("",0);
                        i = 0;
                        if(temp == true)
                        {
                            players.splice(0, players.length);
                            $('#dangerAlert').removeClass('no_display').addClass('display');
                        }
                        else
                        {
                            $('#dangerAlert').removeClass('display').addClass('no_display');
                            while (players.length != 0)
                            {
                                // i=0;
                                let arrayExtract = new Array();

                                for(let j = 0; j< 2; j++)
                                {
                                    random = Math.floor(Math.random() * players.length)
                                    // console.log('the generated random number is: '+ random);
                                    arrayExtract.push(players[random]);

                                    players.splice(random, 1);
                                }
                                // console.log(arrayExtract);
                                i = i+1;
                                $("#teamsDiv").append('

Team' + i+ '

'
                                +arrayExtract[0]+', '+ arrayExtract[1] + '

');
                                arrayExtract.splice(0, arrayExtract.length);
                            }
                            $('#list').removeClass('display');
                            $('#list').addClass('no_display');
                        }
                    })

the above code is not working.

i want know why the listSubmit click event code is not working if the code is outside the loop of first section.


问:
TDengine database 2.6 cluster failed to build
The first node had data. Now add the second node tdengine-server-b, but the status not received cannot be added.

I want to add the second node tdengine-server-b


问:
Weird behaviour when trying to debug class in IntelliJ
Since receiving a new laptop from my new employer, the debugger has been behaving differently to previous experiences (been using IntelliJ on macOs and Windows for years)

I invoke the debugger by creating and running a "Remote JVM debug configuration". When I run the java command to run the code, I provided some parameters so debugging would work.

Previous / preferable behavior: The debugger will open my .java file and stop at the breakpoint.

New behaviour: The debugger will open the .class file (decompiled version of the .class from the .jar file) and stop at the breakpoint.

How do I get back the old behavior back?


问:
How to add dark mode color to NSView layer color
I've added a light mode color and a dark mode colour and set the color like this.

```<code>override func viewDidLoad() {
    super.viewDidLoad()
    titleLabel.textColor = .CP2
    view.wantsLayer = true
    view.layer?.backgroundColor = NSColor.myColor.cgColor
}
</code>```

Regardless of dark mode and light mode, the color is always the Any Appearance color.

Body:
I've added a light mode color and a dark mode colour and set the color like this.

override func viewDidLoad() {
    super.viewDidLoad()
    titleLabel.textColor = .CP2
    view.wantsLayer = true
    view.layer?.backgroundColor = NSColor.myColor.cgColor
}

Regardless of dark mode and light mode, the color is always the Any Appearance color.


问:
Prevent deadlock SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction - Laravel
I need help with preventing deadlocks. How can I update my code to prevent or minimize deadlocks?

The 'ProductAutoMapUpdater' is executed by admin and it is also executed as a background process at a specified interval.

I am getting below deadlock errors in different tables, for the job 'ProductAutoMapUpdater':

```<code>SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction (SQL: insert into `product_accessories` (`accessory_id`, `product_id`, `created_at`, `updated_at`, `cross_sell`) values (54392d5a-565f-486b-b17c-4cf7e6dc53bd, 2d7c997e-7591-4e08-b12f-88ff9e3f359d, 2023-01-05 17:05:54, 2023-01-05 17:05:54, 1))

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction (SQL: update `categories` set `from_only_product_id` = bcfe0008-4374-420a-b62e-c67b3fc56c68, `categories`.`updated_at` = 2023-01-05 17:05:47 where `id` = 368)

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction (SQL: update `products` set `products`.`updated_at` = 2023-01-05 17:05:39 where `id` = f0cdfb07-23ad-4767-b1dd-420d5b1acff0)
</code>```

The below Job invokes multiple auto mapper classes, all of which update products related data (products, categories, accessories, vouchers, medias,..).

App\Jobs\ProductAutoMapUpdater file

```<code>/**
 * Invokable auto mapper classes that will update the product.
 *
 * @var array
 */
protected $autoMappers = [
    UpdateDefaultExtendedAttributes::class,
    UpdateCrossSellAccessories::class,
    UpdatePrimaryProductCategory::class,
    UpdateSecondaryCategories::class,
    UpdateRelatedProductAccessories::class,
    UpdateProductVouchers::class,
    UpdateRelatedProductMedia::class,
    UpdateRelatedProductDescription::class,
    UpdateRelatedProductAccessory::class,
    UpdateProductListedMarker::class,
    UpdateCategoryFromOnlyPrice::class,
    UpdateWarranty::class,
    UpdateYoutubeVideo::class,
];

/**
 * The product to be auto mapped.
 *
 * @var Product
 */
public $product;

/**
 * Create a new job instance.
 *
 * @return void
 */
public function __construct(Product $product)
{
    $this->delay = 5;

    $this->product = $product;
}

/**
 * Get the middleware the job should pass through.
 *
 * @return array
 */
public function middleware()
{
    return [
        (new WithoutOverlapping($this->product->id))->dontRelease(),
    ];
}

/**
 * Execute the job.
 *
 * @return void
 */
public function handle()
{
    try {
        DB::beginTransaction();

        foreach ($this->autoMappers as $class) {
            $obj = new $class;

            if (is_callable($obj)) {
                $obj($this->product->refreshWithScopes());
            }
        }

        DB::commit();
    } catch (DuplicateSlug $exception) {
        DB::rollback();

        Log::info($exception->getMessage());

        return;
    } catch (\Exception $exception) {
        DB::rollback();

        throw $exception;
    }
}
</code>```

Some of the classes above also have auto mappers further.
For instance, UpdateCrossSellAccessories has below:

```<code>/**
 * Auto map product.
 *
 * @param Product $product
 *
 * @return Product
 */
public static function autoMap(Product $product): Product
{
    $product->accessories()->wherePivot('cross_sell', true)->detach();

    return app(Pipeline::class)
        ->send($product)
        ->through([
            \App\Automation\CrossSellMapping\SearchByManufacturer::class,
            \App\Automation\CrossSellMapping\SearchByProductType::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerAndProductType::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerAndModel::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerModelAndProductType::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerAndAttribute::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerProductTypeAndAttribute::class,
            \App\Automation\CrossSellMapping\SearchByProductTypeAndAttribute::class,
            \App\Automation\CrossSellMapping\SearchByAnyAttribute::class,
            \App\Automation\CrossSellMapping\SearchByExactMatch::class,
        ])->then(function ($product) {
            return $product;
        });
}
</code>```

Body:
I need help with preventing deadlocks. How can I update my code to prevent or minimize deadlocks?

The 'ProductAutoMapUpdater' is executed by admin and it is also executed as a background process at a specified interval.

I am getting below deadlock errors in different tables, for the job 'ProductAutoMapUpdater':

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction (SQL: insert into `product_accessories` (`accessory_id`, `product_id`, `created_at`, `updated_at`, `cross_sell`) values (54392d5a-565f-486b-b17c-4cf7e6dc53bd, 2d7c997e-7591-4e08-b12f-88ff9e3f359d, 2023-01-05 17:05:54, 2023-01-05 17:05:54, 1))

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction (SQL: update `categories` set `from_only_product_id` = bcfe0008-4374-420a-b62e-c67b3fc56c68, `categories`.`updated_at` = 2023-01-05 17:05:47 where `id` = 368)

SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction (SQL: update `products` set `products`.`updated_at` = 2023-01-05 17:05:39 where `id` = f0cdfb07-23ad-4767-b1dd-420d5b1acff0)

The below Job invokes multiple auto mapper classes, all of which update products related data (products, categories, accessories, vouchers, medias,..).

App\Jobs\ProductAutoMapUpdater file

/**
 * Invokable auto mapper classes that will update the product.
 *
 * @var array
 */
protected $autoMappers = [
    UpdateDefaultExtendedAttributes::class,
    UpdateCrossSellAccessories::class,
    UpdatePrimaryProductCategory::class,
    UpdateSecondaryCategories::class,
    UpdateRelatedProductAccessories::class,
    UpdateProductVouchers::class,
    UpdateRelatedProductMedia::class,
    UpdateRelatedProductDescription::class,
    UpdateRelatedProductAccessory::class,
    UpdateProductListedMarker::class,
    UpdateCategoryFromOnlyPrice::class,
    UpdateWarranty::class,
    UpdateYoutubeVideo::class,
];

/**
 * The product to be auto mapped.
 *
 * @var Product
 */
public $product;

/**
 * Create a new job instance.
 *
 * @return void
 */
public function __construct(Product $product)
{
    $this->delay = 5;

    $this->product = $product;
}

/**
 * Get the middleware the job should pass through.
 *
 * @return array
 */
public function middleware()
{
    return [
        (new WithoutOverlapping($this->product->id))->dontRelease(),
    ];
}

/**
 * Execute the job.
 *
 * @return void
 */
public function handle()
{
    try {
        DB::beginTransaction();

        foreach ($this->autoMappers as $class) {
            $obj = new $class;

            if (is_callable($obj)) {
                $obj($this->product->refreshWithScopes());
            }
        }

        DB::commit();
    } catch (DuplicateSlug $exception) {
        DB::rollback();

        Log::info($exception->getMessage());

        return;
    } catch (\Exception $exception) {
        DB::rollback();

        throw $exception;
    }
}

Some of the classes above also have auto mappers further.
For instance, UpdateCrossSellAccessories has below:

/**
 * Auto map product.
 *
 * @param Product $product
 *
 * @return Product
 */
public static function autoMap(Product $product): Product
{
    $product->accessories()->wherePivot('cross_sell', true)->detach();

    return app(Pipeline::class)
        ->send($product)
        ->through([
            \App\Automation\CrossSellMapping\SearchByManufacturer::class,
            \App\Automation\CrossSellMapping\SearchByProductType::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerAndProductType::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerAndModel::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerModelAndProductType::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerAndAttribute::class,
            \App\Automation\CrossSellMapping\SearchByManufacturerProductTypeAndAttribute::class,
            \App\Automation\CrossSellMapping\SearchByProductTypeAndAttribute::class,
            \App\Automation\CrossSellMapping\SearchByAnyAttribute::class,
            \App\Automation\CrossSellMapping\SearchByExactMatch::class,
        ])->then(function ($product) {
            return $product;
        });
}


问:
Signed URL to upload audio files in GCP
I was creating a signed URL for uploading an audio file. Url is used in Android apps. It's migration from azure to GCP so can write azure code here:

```<code>    String cdnUrl = fileUploadConfig.has(containerName) ? fileUploadConfig.getString(containerName)
            : Constants.AZURE_STORAGE_URL;

    BlobServiceClient client = new BlobServiceClientBuilder().connectionString(storageConnectionString)
            .buildClient();
    BlobClient blobClient = client.getBlobContainerClient(containerName).getBlobClient(key);
    BlobSasPermission blobSasPermission = new BlobSasPermission().setWritePermission(true);

    OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
    BlobServiceSasSignatureValues values = new BlobServiceSasSignatureValues(expiryTime, blobSasPermission)
            .setStartTime(OffsetDateTime.now());
    String signature = blobClient.generateSas(values);
    Map<String,String> headerMap = new HashMap<String,String>(){{
        put("x-ms-blob-type","BlockBlob");
    }};
    JSONObject res = new JSONObject();
    System.out.println(blobClient.getBlobUrl());
    cdnUrl +=   key;
    res.put("presignedUrl", blobClient.getBlobUrl() + "?" + signature);
    res.put("cdnUrl", cdnUrl);
    res.put("header",new JSONObject(headerMap) );
    return res.toString();
</code>```

When I am transforming it into GCP, I am writing the following code:

```<code>String cdnUrl;
    try {
        cdnUrl = KhabriUtils.getSecret("s3-cdn-mapping-" + containerName);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        cdnUrl = Constants.GCP_STORAGE_URL;
        e.printStackTrace();
    }

    Storage storage = StorageOptions.newBuilder().setProjectId(Constants.GCP_PROJECT_ID).build().getService();

    // Define resource
    BlobInfo blobInfo = BlobInfo.newBuilder(BlobId.of(containerName, key)).build();

     // Generate Signed URL
    Map<String, String> extensionHeaders = new HashMap<>();
    extensionHeaders.put("Content-Type", "application/octet-stream");

    URL url =
                storage.signUrl(
                    blobInfo,
                    15,
                    TimeUnit.MINUTES,
                    Storage.SignUrlOption.httpMethod(HttpMethod.PUT),
                    Storage.SignUrlOption.withExtHeaders(extensionHeaders),
                    Storage.SignUrlOption.withV4Signature());

    JSONObject res = new JSONObject();
    cdnUrl += key;
    res.put("presignedUrl", url);
    res.put("cdnUrl", cdnUrl);
    res.put("header", new JSONObject(extensionHeaders));
    return res.toString();
</code>```

It is giving me an error
Server response: code 403, body SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.GOOG4-RSA-SHA256

Tried to see if there is any permission missing.

Title: Signed URL to upload audio files in GCP

Body:
I was creating a signed URL for uploading an audio file. Url is used in Android apps. It's migration from azure to GCP so can write azure code here:

    String cdnUrl = fileUploadConfig.has(containerName) ? fileUploadConfig.getString(containerName)
            : Constants.AZURE_STORAGE_URL;

    BlobServiceClient client = new BlobServiceClientBuilder().connectionString(storageConnectionString)
            .buildClient();
    BlobClient blobClient = client.getBlobContainerClient(containerName).getBlobClient(key);
    BlobSasPermission blobSasPermission = new BlobSasPermission().setWritePermission(true);

    OffsetDateTime expiryTime = OffsetDateTime.now().plusDays(1);
    BlobServiceSasSignatureValues values = new BlobServiceSasSignatureValues(expiryTime, blobSasPermission)
            .setStartTime(OffsetDateTime.now());
    String signature = blobClient.generateSas(values);
    Map<String,String> headerMap = new HashMap<String,String>(){{
        put("x-ms-blob-type","BlockBlob");
    }};
    JSONObject res = new JSONObject();
    System.out.println(blobClient.getBlobUrl());
    cdnUrl +=   key;
    res.put("presignedUrl", blobClient.getBlobUrl() + "?" + signature);
    res.put("cdnUrl", cdnUrl);
    res.put("header",new JSONObject(headerMap) );
    return res.toString();

When I am transforming it into GCP, I am writing the following code:

String cdnUrl;
    try {
        cdnUrl = KhabriUtils.getSecret("s3-cdn-mapping-" + containerName);
    } catch (Exception e) {
        // TODO Auto-generated catch block
        cdnUrl = Constants.GCP_STORAGE_URL;
        e.printStackTrace();
    }

    Storage storage = StorageOptions.newBuilder().setProjectId(Constants.GCP_PROJECT_ID).build().getService();

    // Define resource
    BlobInfo blobInfo = BlobInfo.newBuilder(BlobId.of(containerName, key)).build();

     // Generate Signed URL
    Map<String, String> extensionHeaders = new HashMap<>();
    extensionHeaders.put("Content-Type", "application/octet-stream");

    URL url =
                storage.signUrl(
                    blobInfo,
                    15,
                    TimeUnit.MINUTES,
                    Storage.SignUrlOption.httpMethod(HttpMethod.PUT),
                    Storage.SignUrlOption.withExtHeaders(extensionHeaders),
                    Storage.SignUrlOption.withV4Signature());

    JSONObject res = new JSONObject();
    cdnUrl += key;
    res.put("presignedUrl", url);
    res.put("cdnUrl", cdnUrl);
    res.put("header", new JSONObject(extensionHeaders));
    return res.toString();

It is giving me an error
Server response: code 403, body SignatureDoesNotMatchThe request signature we calculated does not match the signature you provided. Check your Google secret key and signing method.GOOG4-RSA-SHA256

Tried to see if there is any permission missing.


问:
How to use break last json while requesting for pagination through js
I have a large Json in which there are 400-500k urls. i want to create HTML using json in which 1000 URLs in each page. The problem is that we need to load whole json at that time can we somehow load only 1000 urls according to page number from json directly.

I know a simple solution is using database. i am just expecting solution with JSON file. i don't wanna use database.


问:
uniswapv3 NonfungiblePositionManager positions ,get token0 and token1 and fee data
my write interface

```<code>interface UniRouter {
   function positions(uint256 tokenId) external view returns (uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1);
}
</code>```

then deploy tool contract...

```<code>contract Tool
{
   function test(address a,uint256 b)public  view  returns (address c,address d)
   {
    UniRouter(a).positions(b); // then . What should I do? return toekn0 token1 and fee data.
   }
}
</code>```

Body:
my write interface

interface UniRouter {
   function positions(uint256 tokenId) external view returns (uint96 nonce, address operator, address token0, address token1, uint24 fee, int24 tickLower, int24 tickUpper, uint128 liquidity, uint256 feeGrowthInside0LastX128, uint256 feeGrowthInside1LastX128, uint128 tokensOwed0, uint128 tokensOwed1);
}

then deploy tool contract...

contract Tool
{
   function test(address a,uint256 b)public  view  returns (address c,address d)
   {
    UniRouter(a).positions(b); // then . What should I do? return toekn0 token1 and fee data.
   }
}


问:
How to convert string data fetched from Phabricator file.download API into file?
I want to download files from Phabricator via API. I am aware that the API required is https://secure.phabricator.com/conduit/method/file.download/

However, I am not sure how to process the API's response & convert the string in the response into its respective file. Screenshot of a sample response attached below

In this case the it is a .jgp file but it can be any file like .txt, .gzip, .md etc

Approaches already tried:

Directly piping into file. For eg:

```<code>curl https://my-domain.com/api/file.download -d "api.token"="<my-api-token>" -d "phid"="PHID-FILE-pi2xipuku7ckyrm3feqr" | jq  .result | tee a.png
</code>```

Trying a base64 decode (Response was base64: invalid input)

```<code>curl https://my-domain.com/api/file.download -d "api.token"="<my-api-token>" -d "phid"="PHID-FILE-pi2xipuku7ckyrm3feqr" | jq   .result | base64 -d | tee a.png
</code>```

I already looked around for documentation on this but unable to find any.

Would appreciate some help regarding this. Thanks!

Body:
I want to download files from Phabricator via API. I am aware that the API required is https://secure.phabricator.com/conduit/method/file.download/

However, I am not sure how to process the API's response & convert the string in the response into its respective file. Screenshot of a sample response attached below

In this case the it is a .jgp file but it can be any file like .txt, .gzip, .md etc

Approaches already tried:

Directly piping into file. For eg:

curl https://my-domain.com/api/file.download -d "api.token"="<my-api-token>" -d "phid"="PHID-FILE-pi2xipuku7ckyrm3feqr" | jq  .result | tee a.png

Trying a base64 decode (Response was base64: invalid input)

curl https://my-domain.com/api/file.download -d "api.token"="<my-api-token>" -d "phid"="PHID-FILE-pi2xipuku7ckyrm3feqr" | jq   .result | base64 -d | tee a.png

I already looked around for documentation on this but unable to find any.

Would appreciate some help regarding this. Thanks!


问:
I hosted a django website on namecheap but it has changed structure
I have hosted a django business directory system on namecheap but the home page has changed.
That's my localhost display of the front end

This is the display of app on thena.thenadaka.com

I checked the console to see if there's any static file that is not served but all are served. I know am supposed to learn Docker to ease this but for now your help with be paramount. The code for both is exactly the same, i also disabled Cache under Network on localhost so the locally hosted site doesn'd display cached data


问:
Failed to authenticate on SMTP server with username "d0234aa6969603" using 3 possible authenticators. using laravel 8
I am using mailtrap.io for sending emails i am trying to send emails but unfortunatly i am getting error please help me how can i resolved that thank u.

please check error. https://flareapp.io/share/Rmr2ZAqm

```<code>MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=d0234aa6969603
MAIL_PASSWORD=2d973b871e67d5
MAIL_ENCRYPTION=tls
</code>```

Body:
I am using mailtrap.io for sending emails i am trying to send emails but unfortunatly i am getting error please help me how can i resolved that thank u.

please check error. https://flareapp.io/share/Rmr2ZAqm

MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=d0234aa6969603
MAIL_PASSWORD=2d973b871e67d5
MAIL_ENCRYPTION=tls


问:
Socket.io middleware returns undefimed next() function using Deno
I'm using Deno, and this is my code:

```<code>import {serve} from "https://deno.land/std@0.150.0/http/server.ts";
import { Server } from "https://deno.land/x/socket_io@0.1.1/mod.ts";

const io = new Server({
    cors: {
        origin: "http://localhost:3000"
    }
});

io.use((socket, next) => {
    console.log(next)
    next();
});

await serve(io.handler(), {
    port: 3001,
});
</code>```

my next function return undefined why is that? i can't get it to work

Body:
I'm using Deno, and this is my code:

import {serve} from "https://deno.land/std@0.150.0/http/server.ts";
import { Server } from "https://deno.land/x/socket_io@0.1.1/mod.ts";

const io = new Server({
    cors: {
        origin: "http://localhost:3000"
    }
});

io.use((socket, next) => {
    console.log(next)
    next();
});

await serve(io.handler(), {
    port: 3001,
});

my next function return undefined why is that? i can't get it to work


问:
How to know, in the client, that an OAUTH completed succesfully server-side
Disclaimer: I'm a novice as far as client/server, webdevelopment and oauth is concerned.

I have to integrate against an OAuth-like backend that, upon success, returns a userId.
So I currently do something like

from the client, call a firebase cloud function

from the cloud function, I initiate the OAuth by calling a function offered by the backend

```<code><oauth-domein>/oauth2/authorize/?client_id={client_id}&response_type=code&redirect_url={redirect_url}...
</code>```

Within this call, the credentials of the user are asked and are redirected to us

in the redirect (another cloud function), we will

request an OAuth access token (another call to the backend)

with this access_token, we can request information on the user (like userId)

we can check whether this userId exists and if not, we can create one using

```<code>admin.auth().getUser(uid)
admin.auth().createUser({uid: uid})
</code>```

At this point, we have a User in firebase and I would like to let the client side know that the OAuth succeeded.

For other sign-in methods (email/password, facebook, OpenID Connect), the client is notified of userChanges (I'm using Dart)

```<code>FirebaseAuth.instance.userChanges().listen((User? user) {...});
</code>```

So ideally, I would also like to trigger this userChanges-event from the firebase cloud function. But how can I do this?

I guess I have to authenticate the userId in firebase (which will trigger the userChanges-event I guess). I was trying to do something like

```<code>      const customToken = await admin.auth().createCustomToken(uid);
      admin.auth().signInWithCustomToken(customToken);
</code>```

But there doesn't seem to be a signInWithCustomToken in admin.auth().

So I have the following questions

can I trigger the userChanges() event from within a firebase cloud function (which is probably the same question as "can I authenticate a known userId in a firebase cloud function")

if the answer to the above question is 'no': how can I notify the client that the OAuth was succesful?

bonus question: I would like to make this backend OpenID Connect compliant since that is supported out of the box by Firebase.  Any pointers on what is needed to do so?

Body:
Disclaimer: I'm a novice as far as client/server, webdevelopment and oauth is concerned.

I have to integrate against an OAuth-like backend that, upon success, returns a userId.
So I currently do something like

from the client, call a firebase cloud function

from the cloud function, I initiate the OAuth by calling a function offered by the backend

<oauth-domein>/oauth2/authorize/?client_id={client_id}&response_type=code&redirect_url={redirect_url}...

Within this call, the credentials of the user are asked and are redirected to us

in the redirect (another cloud function), we will

request an OAuth access token (another call to the backend)

with this access_token, we can request information on the user (like userId)

we can check whether this userId exists and if not, we can create one using

admin.auth().getUser(uid)
admin.auth().createUser({uid: uid})

At this point, we have a User in firebase and I would like to let the client side know that the OAuth succeeded.

For other sign-in methods (email/password, facebook, OpenID Connect), the client is notified of userChanges (I'm using Dart)

FirebaseAuth.instance.userChanges().listen((User? user) {...});

So ideally, I would also like to trigger this userChanges-event from the firebase cloud function. But how can I do this?

I guess I have to authenticate the userId in firebase (which will trigger the userChanges-event I guess). I was trying to do something like

      const customToken = await admin.auth().createCustomToken(uid);
      admin.auth().signInWithCustomToken(customToken);

But there doesn't seem to be a signInWithCustomToken in admin.auth().

So I have the following questions

can I trigger the userChanges() event from within a firebase cloud function (which is probably the same question as "can I authenticate a known userId in a firebase cloud function")

if the answer to the above question is 'no': how can I notify the client that the OAuth was succesful?

bonus question: I would like to make this backend OpenID Connect compliant since that is supported out of the box by Firebase.  Any pointers on what is needed to do so?


问:
useSelector does not update its value but the state is current
I would like to understand why when the store is changed, the value in the useSelector is not updated.

I have two screens: screen A and screen B.

Screen A contains a FlatList which receives data from the redux.

Screen B contains a button that adds or removes items from the redux.

I am on Screen A -> I go to Screen B -> I remove an item from the redux -> I return to Screen A -> FlastList still contains the deleted item -> I go to Screen B again and return -> FlatList is updated fine.

Yet, if I view the console.log, the redux state is updated, but the template is not.

I don't know if I'm misunderstanding the concept or not, but I assume that the data should be propagated directly to the sheet as well.

import {useSelector} from 'react-redux';

export default function ScreenA() {
  const timelines = useSelector((state: RootState) => {
    // Once a removal or addition occurs, it's up-to-date right away
    console.log(subscribedTimelines(state)); //->Returns the updated array
    return subscribedTimelines(state);
  });
  return (
    <View style={{flex: 1}}>
      {/*The timelines variable still contains the old number of items, even if the state is updated.*/}
      <FlatList
        data={timelines}
        keyExtractor={item => item.id}
        renderItem={({item}) => (
          <TouchableWithoutFeedback>
            <View>
              <TimelineListItem timeline={item} />
            </View>
          </TouchableWithoutFeedback>
        )}
      />
    </View>
  );
}
```

Can someone please explain to me why this is not the case? Thank you!

Body:
I would like to understand why when the store is changed, the value in the useSelector is not updated.

I have two screens: screen A and screen B.

Screen A contains a FlatList which receives data from the redux.

Screen B contains a button that adds or removes items from the redux.

I am on Screen A -> I go to Screen B -> I remove an item from the redux -> I return to Screen A -> FlastList still contains the deleted item -> I go to Screen B again and return -> FlatList is updated fine.

Yet, if I view the console.log, the redux state is updated, but the template is not.

I don't know if I'm misunderstanding the concept or not, but I assume that the data should be propagated directly to the sheet as well.

import {useSelector} from 'react-redux';

export default function ScreenA() {
  const timelines = useSelector((state: RootState) => {
    // Once a removal or addition occurs, it's up-to-date right away
    console.log(subscribedTimelines(state)); //->Returns the updated array
    return subscribedTimelines(state);
  });
  return (
    <View style={{flex: 1}}>
      {/*The timelines variable still contains the old number of items, even if the state is updated.*/}
      <FlatList
        data={timelines}
        keyExtractor={item => item.id}
        renderItem={({item}) => (
          <TouchableWithoutFeedback>
            <View>
              <TimelineListItem timeline={item} />
            </View>
          </TouchableWithoutFeedback>
        )}
      />
    </View>
  );
}

Can someone please explain to me why this is not the case? Thank you!


问:
Finding the price of a product with sub-variables and giving it as a link?
I have got a sheet.

Like This : https://docs.google.com/spreadsheets/d/1IZKQENWb9JOeVvjU3ioj6769PvHcRtXmo-urZZ8R3CQ/edit?usp=sharing

This list includes the products, the main features of the products and their prices according to these basic features.

What I want to do is; when they click on these essential features, they go to the price of their own feature. I don't want to do this manually one by one because there are too many products. I want to create it by writing a formula.

Anyone help this? Thank you :)


问:
Order By NewID()
I have a quick question and below is my sample query:

```<code>    select
        ROW_NUMBER()OVER(PARTITION BY diff ORDER BY NEWID())
        , Account, Ticker, Client, Diff, Allocation
    from @diffAdj
    where
        Account = @Account
        and Ticker = @Ticker
        and RemainingShares - isnull(Allocation, 0) > 0
    order by NEWID()
</code>```

Just want to ask a question on the NEWID(). The NEWID is also used to get the row_Number partitioned, which should be executed before order by. So is my understanding as below correct:

As of each row looped, a newid is generated and stored in the new column created
This newid will be used to sort rows to generate row_number
The same new_id column will be used to sort rows in the order stage, or will it discard the newid from previous step and loop through each row and generate the newid column again, and sort it again usingthe new column.

I'm a very very very beginner in sql, appreciate everyone's help.

Title: Order By NewID()

Body:
I have a quick question and below is my sample query:

    select
        ROW_NUMBER()OVER(PARTITION BY diff ORDER BY NEWID())
        , Account, Ticker, Client, Diff, Allocation
    from @diffAdj
    where
        Account = @Account
        and Ticker = @Ticker
        and RemainingShares - isnull(Allocation, 0) > 0
    order by NEWID()

Just want to ask a question on the NEWID(). The NEWID is also used to get the row_Number partitioned, which should be executed before order by. So is my understanding as below correct:

As of each row looped, a newid is generated and stored in the new column created
This newid will be used to sort rows to generate row_number
The same new_id column will be used to sort rows in the order stage, or will it discard the newid from previous step and loop through each row and generate the newid column again, and sort it again usingthe new column.

I'm a very very very beginner in sql, appreciate everyone's help.


问:
Determine correct angle of hour hand in analog clock formation in Android Canvas
I am unable to find correct angle for hour hand of analog clock formation, other two angles are working fine, but hour angle does not displace during time of hour, like when time is 12:00, hour hand will be on correct place but as time pass and time increases in minutes, hour hand does not displace from its original place and will only change its position when time will be 1:00, Please help in in this situation.

```<code>private fun drawHand(canvas: Canvas, loc: Int, isHour: Boolean) {
        val angle = (Math.PI * loc / 30 - Math.PI / 2).toFloat()
        val handRadius: Float =
            if (isHour) getTextHeight(bigTextSize) * .5f else getTextHeight(bigTextSize) * .9f
        canvas.drawLine(
            relativePoint,
            currentHeight + getTextHeight(bigTextSize),
            relativePoint + cos(angle) * handRadius,
            currentHeight + getTextHeight(bigTextSize) + sin(angle) * handRadius,
            templatePaint
        )
    }
val c = Calendar.getInstance()
                val minute=c[Calendar.MINUTE]
                val hour = if (c[Calendar.HOUR_OF_DAY] > 12) c[Calendar.HOUR_OF_DAY] - 12
                else c[Calendar.HOUR_OF_DAY]
                templatePaint.strokeWidth=5f
                drawHand(canvas, c.get(360 * (hour % 12) / 12 ) + ( (minute / 60)), true)
</code>```

I tried all posible solution listed on open source platforms, but could not achieve right thing.
Possible solution is hour hand keep moving with passage of time as real clock needle works,

Body:
I am unable to find correct angle for hour hand of analog clock formation, other two angles are working fine, but hour angle does not displace during time of hour, like when time is 12:00, hour hand will be on correct place but as time pass and time increases in minutes, hour hand does not displace from its original place and will only change its position when time will be 1:00, Please help in in this situation.

private fun drawHand(canvas: Canvas, loc: Int, isHour: Boolean) {
        val angle = (Math.PI * loc / 30 - Math.PI / 2).toFloat()
        val handRadius: Float =
            if (isHour) getTextHeight(bigTextSize) * .5f else getTextHeight(bigTextSize) * .9f
        canvas.drawLine(
            relativePoint,
            currentHeight + getTextHeight(bigTextSize),
            relativePoint + cos(angle) * handRadius,
            currentHeight + getTextHeight(bigTextSize) + sin(angle) * handRadius,
            templatePaint
        )
    }
val c = Calendar.getInstance()
                val minute=c[Calendar.MINUTE]
                val hour = if (c[Calendar.HOUR_OF_DAY] > 12) c[Calendar.HOUR_OF_DAY] - 12
                else c[Calendar.HOUR_OF_DAY]
                templatePaint.strokeWidth=5f
                drawHand(canvas, c.get(360 * (hour % 12) / 12 ) + ( (minute / 60)), true)

I tried all posible solution listed on open source platforms, but could not achieve right thing.
Possible solution is hour hand keep moving with passage of time as real clock needle works,