问:
Xamarin Forms Tap Gesture Two Taps specifically cause Object reference not set to an instance of object in system or framework code
I am experimenting with Xamarin.  I am using the Collection View with Swipe Items.  In the datatemplate I am using a grid that has a gesture recognizer.  I am using the community toolkit's Tabview and this collectionview is in 1 of three tabs.  There is also a flyout page.

I found setting NumberOfTapsRequired="2" in a collection view causes an object reference error.

When I remove it, it all runs fine.

Anyone have insights?

Earlier question from another user

```<code><CollectionView x:Name="testList"
          BackgroundColor = "AntiqueWhite" EmptyView="No items yet!"
          ItemsSource="{Binding ItemsAvailable}"
          Grid.Row="1" Grid.RowSpan="5"
          Grid.Column="0" Grid.ColumnSpan="6"
          >
    <CollectionView.ItemTemplate>
        <DataTemplate>
            <SwipeView>
                <SwipeView.LeftItems>
                    <SwipeItem Text="Edit"
                               BackgroundColor="Green"
                               Command="{Binding Source={RelativeSource AncestorType={x:Type local:testListViewModel}}, Path=OnEditItem}"
                               CommandParameter="{Binding .}"
                               />
                </SwipeView.LeftItems>
                <Grid RowSpacing="1" ColumnSpacing="1" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="20" />
                        <ColumnDefinition Width="140" />
                    </Grid.ColumnDefinitions>
                    <Label Grid.Column="0" Text="{Binding Name}" VerticalOptions="Center"/>
                    <Label Grid.Column="1" Text="{Binding CurrentDayNumber}" VerticalOptions="Center" />
                    <Label Grid.Column="2" Text="{Binding DateUpdate}" VerticalOptions="Center" />
                    <!-- Separator -->
                    <BoxView HeightRequest="1"
                       BackgroundColor="Black"
                       Grid.ColumnSpan="3"
                       Grid.Row="2"
                       VerticalOptions="End"/>
                    <Grid.GestureRecognizers>
                        <TapGestureRecognizer
                        Tapped="AdventureListItem_Tapped"
                            NumberOfTapsRequired="2"
                        Command="{Binding Source={RelativeSource AncestorType={x:Type local:testListViewModel}}, Path=ItemTappedCommand}"
                        CommandParameter="{Binding .}"/>
                    </Grid.GestureRecognizers>
                </Grid>
            </SwipeView>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

</code>```

Messages after hitting "Continue" 3 times.

```<code>
**System.NullReferenceException:** 'Object reference not set to an instance of an object.'

The thread 0x10 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #16
Thread finished: <Thread Pool> #10
The thread 0xa has exited with code 0 (0x0).
Thread finished: <Thread Pool> #12
The thread 0xc has exited with code 0 (0x0).
The thread 0xd has exited with code 0 (0x0).
Thread finished: <Thread Pool> #13
Thread finished: <Thread Pool> #15
The thread 0xf has exited with code 0 (0x0).
The thread 0x8 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #8
**System.NullReferenceException:** 'Object reference not set to an instance of an object.'

[e.testapp] java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: JNI NewString called with pending exception android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object.
[e.testapp] java_vm_ext.cc:570]   at Xamarin.Forms.Platform.Android.InnerGestureListener.HasAnyGestures () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\InnerGestureListener.cs:59
[e.testapp] java_vm_ext.cc:570]   at Xamarin.Forms.Platform.Android.InnerGestureListener.Android.Views.GestureDetector.IOnGestureListener.OnDown (Android.Views.MotionEvent e) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\InnerGestureListener.cs:99
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_onTouchEvent(android.view.MotionEvent) (Platform_Default02-04 11:44:09.798 F/e.testapp(10245): java_vm_ext.cc:570]   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.122(intptr,intptr,intptr)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.InnerGestureListener.n_onDown(android.view.MotionEvent) (InnerGestureListener.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.InnerGestureListener.onDown(android.view.MotionEvent) (InnerGestureListener.java:39)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.GestureDetector.onTouchEvent(android.view.MotionEvent) (GestureDetector.java:630)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_onTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.onTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:48)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.View.dispatchTouchEvent(android.view.MotionEvent) (View.java:13415)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3054)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2741)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.SwipeViewRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (SwipeViewRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.SwipeViewRenderer.dispatchTouchEvent(android.view.MotionEvent) (SwipeViewRenderer.java:72)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platfor02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.VisualElementRenderer_1.n_dispatchTouchEvent(android.view.MotionEvent) (VisualElementRenderer_1.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, and02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.vi02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int)02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean a02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.PlatformRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (PlatformRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.PlatformRenderer.dispatchTouchEvent(android.view.MotionEvent) (PlatformRenderer.java:55)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.du02-04 11:44:09.799 F] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean com.android.internal.policy.DecorView.superDispatchTouchEvent(android.view.MotionEvent) (DecorView.java:465)
[e.testapp] java_vm_ext.cc:570]   at boolean android.app.Activity.dispatchTouchEvent(android.view.MotionEvent) (Activity.java:3993)
[e.testapp] java_vm_ext.cc:570]   at void android.view02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(android.view.MotionEvent) (WindowCallbackWrapper.java:69)
[e.testapp] java_vm_ext.cc:570]   at boolean androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(android.view.MotionEvent) (WindowCallbackWrapper.java:69)
[e.testapp] java_vm_ext.cc:570]   at boolean com.android.internal.policy.DecorView.dispatchTouchEvent(android.view.MotionEvent) (DecorView.java:423)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.View.dispatchPointerEvent(android.view.MotionEvent) (View.java:13674)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl.deliverInputEvent(android.view.ViewRootImpl$QueuedInputEvenva_vm_ext.cc:570]   at int android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:5482)
[e.testapp] java_vm_ext.cc:570]   at int android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:5285)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.deliver(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4788)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.onDeliverToNext(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4841)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.forward(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4807)
[e.testapp] java_vm_ext.cc:570]   at android.os.Message android.os.MessageQueue.niewRootImpl$AsyncInputStage.forward(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4947)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.apply(android.view.ViewRootImpl$QueuedInputEvent, int) (ViewRootImpl.java:4815)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$AsyncInputStage.apply(android.view.ViewRootImpl$QueuedInputEvent, int) (ViewRootImpl.java:5004)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.deliver(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4788)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.onDeliverToNext(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4841)
[e.testapp] java_vm_ext.cc:570]     from boolean cuedInputEvent) (ViewRootImpl.java:4807)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.apply(android.view.ViewRootImpl$QueuedInputEvent, int) (ViewRootImpl.java:4815)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.deliver(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4788)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl.deliverInputEvent(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:7505)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl.doProcessInputEvents() (ViewRootImpl.java:7474)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl.enqueueInputEvent(android.view.InputEvent, android.view.InputEventReceiver, int, boolean) (ViewRootImpl.java:7435)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(android.view.InputEvent) (ViewRootImpl.java:7630)
[e.testapp] java_vm_ext.cc:570]   at void android.view.InputEventReceiver.dispatchInputEvent(int, android.view.InputEvent) (InputEventReceiver.java:188)
[e.testapp] java_vm_ext.cc:570]   at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
[e.testapp] java_vm_ext.cc:570]   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:336)
[e.testapp] java_vm_ext.cc:570]   at void android.os.Looper.loop() (Looper.java:174)
[e.testapp] java_vm_ext.cc:570]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7356)
[e.testapp] java_vm_ext.cc:570]   at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
[e.testapp] java_vm_ext.cc:570]   at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:492)
[e.testapp] java_vm_ext.cc:570]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:930)
[e.testapp] java_vm_ext.cc:570]
[e.testapp] java_vm_ext.cc:570]     in call to NewString
[e.testapp] java_vm_ext.cc:570]     from boolean crc643f46942d9dd1fff9.InnerGestureListener.n_onDown(android.view.MotionEvent)
[libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x40 in tid 10245 (e.testappe), pid 10245 (e.testappe)
</code>```

答:
You could refer to the code below. It works well for me.

The same xaml as yours.

Mode:

```<code>public class test
{
    public string Name { get; set; }
    public string CurrentDayNumber { get; set; }
    public string DateUpdate { get; set; }
}
</code>```

ViewModel:

```<code>public class testListViewModel
{
    public ObservableCollection<test> ItemsAvailable { get; set; }
    public Command OnEditItem { get; set; }
    public Command ItemTappedCommand { get; set; }

    public testListViewModel()
    {
        OnEditItem = new Command(() =>
          {
              Console.WriteLine("OnEditItem");
          });

        ItemTappedCommand = new Command(() =>
        {
            Console.WriteLine("ItemTappedCommand");
        });
        ItemsAvailable = new ObservableCollection<test>()
        {
            new test(){ Name="A", CurrentDayNumber="1", DateUpdate= "2022/12/01"},
            new test(){ Name="B", CurrentDayNumber="2", DateUpdate= "2022/12/01"},
            new test(){ Name="C", CurrentDayNumber="3", DateUpdate= "2022/12/01"},
        };
    }
}
</code>```

Code behind:

```<code>public partial class Page9 : ContentPage
{
    public Page9()
    {
        InitializeComponent();
        this.BindingContext = new testListViewModel();
    }

    private void AdventureListItem_Tapped(object sender, EventArgs e)
    {
        Console.WriteLine("AdventureListItem_Tapped");
    }
}
</code>```

Body:
I am experimenting with Xamarin.  I am using the Collection View with Swipe Items.  In the datatemplate I am using a grid that has a gesture recognizer.  I am using the community toolkit's Tabview and this collectionview is in 1 of three tabs.  There is also a flyout page.

I found setting NumberOfTapsRequired="2" in a collection view causes an object reference error.

When I remove it, it all runs fine.

Anyone have insights?

Earlier question from another user

<CollectionView x:Name="testList"
          BackgroundColor = "AntiqueWhite" EmptyView="No items yet!"
          ItemsSource="{Binding ItemsAvailable}"
          Grid.Row="1" Grid.RowSpan="5"
          Grid.Column="0" Grid.ColumnSpan="6"
          >
    <CollectionView.ItemTemplate>
        <DataTemplate>
            <SwipeView>
                <SwipeView.LeftItems>
                    <SwipeItem Text="Edit"
                               BackgroundColor="Green"
                               Command="{Binding Source={RelativeSource AncestorType={x:Type local:testListViewModel}}, Path=OnEditItem}"
                               CommandParameter="{Binding .}"
                               />
                </SwipeView.LeftItems>
                <Grid RowSpacing="1" ColumnSpacing="1" >
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*" />
                        <ColumnDefinition Width="20" />
                        <ColumnDefinition Width="140" />
                    </Grid.ColumnDefinitions>

                    <BoxView HeightRequest="1"
                       BackgroundColor="Black"
                       Grid.ColumnSpan="3"
                       Grid.Row="2"
                       VerticalOptions="End"/>
                    <Grid.GestureRecognizers>
                        <TapGestureRecognizer
                        Tapped="AdventureListItem_Tapped"
                            NumberOfTapsRequired="2"
                        Command="{Binding Source={RelativeSource AncestorType={x:Type local:testListViewModel}}, Path=ItemTappedCommand}"
                        CommandParameter="{Binding .}"/>
                    </Grid.GestureRecognizers>
                </Grid>
            </SwipeView>
        </DataTemplate>
    </CollectionView.ItemTemplate>
</CollectionView>

Messages after hitting "Continue" 3 times.

**System.NullReferenceException:** 'Object reference not set to an instance of an object.'

The thread 0x10 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #16
Thread finished: <Thread Pool> #10
The thread 0xa has exited with code 0 (0x0).
Thread finished: <Thread Pool> #12
The thread 0xc has exited with code 0 (0x0).
The thread 0xd has exited with code 0 (0x0).
Thread finished: <Thread Pool> #13
Thread finished: <Thread Pool> #15
The thread 0xf has exited with code 0 (0x0).
The thread 0x8 has exited with code 0 (0x0).
Thread finished: <Thread Pool> #8
**System.NullReferenceException:** 'Object reference not set to an instance of an object.'

[e.testapp] java_vm_ext.cc:570] JNI DETECTED ERROR IN APPLICATION: JNI NewString called with pending exception android.runtime.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object.
[e.testapp] java_vm_ext.cc:570]   at Xamarin.Forms.Platform.Android.InnerGestureListener.HasAnyGestures () [0x00000] in D:\a\1\s\Xamarin.Forms.Platform.Android\InnerGestureListener.cs:59
[e.testapp] java_vm_ext.cc:570]   at Xamarin.Forms.Platform.Android.InnerGestureListener.Android.Views.GestureDetector.IOnGestureListener.OnDown (Android.Views.MotionEvent e) [0x00007] in D:\a\1\s\Xamarin.Forms.Platform.Android\InnerGestureListener.cs:99
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_onTouchEvent(android.view.MotionEvent) (Platform_Default02-04 11:44:09.798 F/e.testapp(10245): java_vm_ext.cc:570]   at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.122(intptr,intptr,intptr)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.InnerGestureListener.n_onDown(android.view.MotionEvent) (InnerGestureListener.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.InnerGestureListener.onDown(android.view.MotionEvent) (InnerGestureListener.java:39)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.GestureDetector.onTouchEvent(android.view.MotionEvent) (GestureDetector.java:630)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_onTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.onTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:48)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.View.dispatchTouchEvent(android.view.MotionEvent) (View.java:13415)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3054)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2741)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.SwipeViewRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (SwipeViewRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.SwipeViewRenderer.dispatchTouchEvent(android.view.MotionEvent) (SwipeViewRenderer.java:72)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platfor02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.Platform_DefaultRenderer.dispatchTouchEvent(android.view.MotionEvent) (Platform_DefaultRenderer.java:56)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.VisualElementRenderer_1.n_dispatchTouchEvent(android.view.MotionEvent) (VisualElementRenderer_1.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, and02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.vi02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int)02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean a02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.PlatformRenderer.n_dispatchTouchEvent(android.view.MotionEvent) (PlatformRenderer.java:-2)
[e.testapp] java_vm_ext.cc:570]   at boolean crc643f46942d9dd1fff9.PlatformRenderer.dispatchTouchEvent(android.view.MotionEvent) (PlatformRenderer.java:55)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.du02-04 11:44:09.799 F] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTransformedTouchEvent(android.view.MotionEvent, boolean, android.view.View, int) (ViewGroup.java:3060)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.ViewGroup.dispatchTouchEvent(android.view.MotionEvent) (ViewGroup.java:2698)
[e.testapp] java_vm_ext.cc:570]   at boolean com.android.internal.policy.DecorView.superDispatchTouchEvent(android.view.MotionEvent) (DecorView.java:465)
[e.testapp] java_vm_ext.cc:570]   at boolean android.app.Activity.dispatchTouchEvent(android.view.MotionEvent) (Activity.java:3993)
[e.testapp] java_vm_ext.cc:570]   at void android.view02-04 11:44:09.799 F/e.testapp(10245): java_vm_ext.cc:570]   at boolean androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(android.view.MotionEvent) (WindowCallbackWrapper.java:69)
[e.testapp] java_vm_ext.cc:570]   at boolean androidx.appcompat.view.WindowCallbackWrapper.dispatchTouchEvent(android.view.MotionEvent) (WindowCallbackWrapper.java:69)
[e.testapp] java_vm_ext.cc:570]   at boolean com.android.internal.policy.DecorView.dispatchTouchEvent(android.view.MotionEvent) (DecorView.java:423)
[e.testapp] java_vm_ext.cc:570]   at boolean android.view.View.dispatchPointerEvent(android.view.MotionEvent) (View.java:13674)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl.deliverInputEvent(android.view.ViewRootImpl$QueuedInputEvenva_vm_ext.cc:570]   at int android.view.ViewRootImpl$ViewPostImeInputStage.processPointerEvent(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:5482)
[e.testapp] java_vm_ext.cc:570]   at int android.view.ViewRootImpl$ViewPostImeInputStage.onProcess(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:5285)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.deliver(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4788)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.onDeliverToNext(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4841)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.forward(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4807)
[e.testapp] java_vm_ext.cc:570]   at android.os.Message android.os.MessageQueue.niewRootImpl$AsyncInputStage.forward(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4947)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.apply(android.view.ViewRootImpl$QueuedInputEvent, int) (ViewRootImpl.java:4815)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$AsyncInputStage.apply(android.view.ViewRootImpl$QueuedInputEvent, int) (ViewRootImpl.java:5004)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.deliver(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4788)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.onDeliverToNext(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4841)
[e.testapp] java_vm_ext.cc:570]     from boolean cuedInputEvent) (ViewRootImpl.java:4807)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.apply(android.view.ViewRootImpl$QueuedInputEvent, int) (ViewRootImpl.java:4815)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$InputStage.deliver(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:4788)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl.deliverInputEvent(android.view.ViewRootImpl$QueuedInputEvent) (ViewRootImpl.java:7505)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl.doProcessInputEvents() (ViewRootImpl.java:7474)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl.enqueueInputEvent(android.view.InputEvent, android.view.InputEventReceiver, int, boolean) (ViewRootImpl.java:7435)
[e.testapp] java_vm_ext.cc:570]   at void android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(android.view.InputEvent) (ViewRootImpl.java:7630)
[e.testapp] java_vm_ext.cc:570]   at void android.view.InputEventReceiver.dispatchInputEvent(int, android.view.InputEvent) (InputEventReceiver.java:188)
[e.testapp] java_vm_ext.cc:570]   at void android.os.MessageQueue.nativePollOnce(long, int) (MessageQueue.java:-2)
[e.testapp] java_vm_ext.cc:570]   at android.os.Message android.os.MessageQueue.next() (MessageQueue.java:336)
[e.testapp] java_vm_ext.cc:570]   at void android.os.Looper.loop() (Looper.java:174)
[e.testapp] java_vm_ext.cc:570]   at void android.app.ActivityThread.main(java.lang.String[]) (ActivityThread.java:7356)
[e.testapp] java_vm_ext.cc:570]   at java.lang.Object java.lang.reflect.Method.invoke(java.lang.Object, java.lang.Object[]) (Method.java:-2)
[e.testapp] java_vm_ext.cc:570]   at void com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run() (RuntimeInit.java:492)
[e.testapp] java_vm_ext.cc:570]   at void com.android.internal.os.ZygoteInit.main(java.lang.String[]) (ZygoteInit.java:930)
[e.testapp] java_vm_ext.cc:570]
[e.testapp] java_vm_ext.cc:570]     in call to NewString
[e.testapp] java_vm_ext.cc:570]     from boolean crc643f46942d9dd1fff9.InnerGestureListener.n_onDown(android.view.MotionEvent)
[libc] Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x40 in tid 10245 (e.testappe), pid 10245 (e.testappe)

Body:
You could refer to the code below. It works well for me.

The same xaml as yours.

Mode:

public class test
{
    public string Name { get; set; }
    public string CurrentDayNumber { get; set; }
    public string DateUpdate { get; set; }
}

ViewModel:

public class testListViewModel
{
    public ObservableCollection<test> ItemsAvailable { get; set; }
    public Command OnEditItem { get; set; }
    public Command ItemTappedCommand { get; set; }

    public testListViewModel()
    {
        OnEditItem = new Command(() =>
          {
              Console.WriteLine("OnEditItem");
          });

        ItemTappedCommand = new Command(() =>
        {
            Console.WriteLine("ItemTappedCommand");
        });
        ItemsAvailable = new ObservableCollection<test>()
        {
            new test(){ Name="A", CurrentDayNumber="1", DateUpdate= "2022/12/01"},
            new test(){ Name="B", CurrentDayNumber="2", DateUpdate= "2022/12/01"},
            new test(){ Name="C", CurrentDayNumber="3", DateUpdate= "2022/12/01"},
        };
    }
}

Code behind:

public partial class Page9 : ContentPage
{
    public Page9()
    {
        InitializeComponent();
        this.BindingContext = new testListViewModel();
    }

    private void AdventureListItem_Tapped(object sender, EventArgs e)
    {
        Console.WriteLine("AdventureListItem_Tapped");
    }
}


来源: stackexchange

问:
Show/Hide Html sections on button click
I have 3 sections of code in the same page, in those 3 sections I have submit buttons.
Initially 1st section should be visible, 2nd and 3rd sections are hidden. On button click from 1st section, 2nd section should become visible and hide 1st and 3rd sections. On button click from 2nd section, 1st and 2nd sections should be hidden and 3rd section should be visible.
Can someone please help?</p>

答:
Is easy first create an html file.

```<code><!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <style>
        .hide {
            display: none;
        }
    </style>
    <body>
        <section id="section-1">
            Section 1
            <button data-section-id="1">Next</button>
        </section>
        <section id="section-2" class="hide">
            Section 2
            <button data-section-id="2">Next</button>
        </section>
        <section id="section-3" class="hide">
            Section 3
            <button data-section-id="3">Next</button>
        </section>
        <script src="./js/script.js"></script>
    </body>
</html>
</code>```

And then a script.js file with your code.

```<code>(() => {
"use strict";

document.querySelectorAll("button").forEach((e) => {
    e.addEventListener("click", showNext);
});

function showNext(e) {
    let nextId, sectionId;
    sectionId = parseInt(e.target.getAttribute("data-section-id"));
    document.getElementById(`section-${sectionId}`).style.display = "none";

    // Next section id
    if (sectionId == 3) {
        nextId = 1;
    } else {
        // Get section id
        nextId = sectionId + 1;
    }
    document.getElementById(`section-${nextId}`).style.display = "block";
}
})();
</code>```

ContentLicense: CC BY-SA 4.0

Title: Show/Hide Html sections on button click

Body:
Is easy first create an html file.

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>Document</title>
    </head>
    <style>
        .hide {
            display: none;
        }
    </style>
    <body>
        <section id="section-1">
            Section 1
            <button data-section-id="1">Next</button>
        </section>
        <section id="section-2" class="hide">
            Section 2
            <button data-section-id="2">Next</button>
        </section>
        <section id="section-3" class="hide">
            Section 3
            <button data-section-id="3">Next</button>
        </section>
        <script src="./js/script.js"></script>
    </body>
</html>

And then a script.js file with your code.

(() => {
"use strict";

document.querySelectorAll("button").forEach((e) => {
    e.addEventListener("click", showNext);
});

function showNext(e) {
    let nextId, sectionId;
    sectionId = parseInt(e.target.getAttribute("data-section-id"));
    document.getElementById(`section-${sectionId}`).style.display = "none";

    // Next section id
    if (sectionId == 3) {
        nextId = 1;
    } else {
        // Get section id
        nextId = sectionId + 1;
    }
    document.getElementById(`section-${nextId}`).style.display = "block";
}
})();


问:
What is the best way to use Ext JS as part of Java / Spring / Hibernate based web application?
We want to try Ext JS on new project. Is there any well-known best practice for integrating Ext JS with server side Java (Spring/Hibernate/JS) application? Is DWR a good choice for that?</p>

答:
Yes it's possible.

I've done the same thing with .NET : UI in ext-JS which communicates with the server trough JSON. In .NET world you can use DataContractSerializer (class from WCF) or JavascriptSerializer (ASP.NET)

I'm sure that there's several good JSON Serializer in the Java world too. I used Jabsorb (but not enough to give you a solid feedback). It appears that other people have tried : [link text][2]

[2]: http://extjs.com/forum/showthread.php?t=30759 forum ext-js

ContentLicense: CC BY-SA 2.5

LastEditorDisplayName: Alan

OwnerDisplayName: Matthieu


问:
How do I share user controls between web applications in ASP.NET?
This question is a follow up to my question about sharing resources between web applications, because I have not yet found a good solution.

I have a web application with user controls and resources that are shared by three other web applications.

```
Solution
|
+-CommonControlsWebApp
| +- resources
| |  +- images
| |  +- scripts
| |  +- stylesheets
| +- UserControls
|
+-WebApp1
|
+-WebApp2
|
+-WebApp3
```

This is what I know this far:

I can not compile CommonControlsWebApp into a single dll since I am creating user controls. This is only possible with custom server controls, where everything is in the code-behind file. So I need a way to share the ascx files between the four projects.

Copying the files from CommonControlsWebApp into the three other projects does not update their files in the solution explorer. I would have to 'add exting items' all in all three WebApps when a file is added or renamed in CommonControls.

Changing to the Web Site model would remedy this, but I am worried about the compile time for WebApp1-3 if I do this.

'Add as link' does not work for directories.

I could use Subversion to share the files between the projects, but i believe that this would require me to check the files in and out again all the time if I am developing a user control that I have to test through one of the WebApps.

Can it really be true that ASP.NET does not have a good solution for this? How are you guys organizing large web applications?

Edit: Thanks a lot for all the answers. I am going to copy my user controls with a build event for now, and then see if we have time to refactor them into server controls.

答:
In order to share controls between web apps, the only way I found was to either rewrite them into server controls or to use virtual directory to make the user controls actually in folder be in each project.

Unfortunately, asp.net doesn't really have a good solution for this. The same is true for sharing master pages.

OwnerDisplayName: Jan Aagaard

Body:
This question is a follow up to my question about sharing resources between web applications, because I have not yet found a good solution.

I have a web application with user controls and resources that are shared by three other web applications.

Solution
|
+-CommonControlsWebApp
| +- resources
| |  +- images
| |  +- scripts
| |  +- stylesheets
| +- UserControls
|
+-WebApp1
|
+-WebApp2
|
+-WebApp3

This is what I know this far:

I can not compile CommonControlsWebApp into a single dll since I am creating user controls. This is only possible with custom server controls, where everything is in the code-behind file. So I need a way to share the ascx files between the four projects.

Copying the files from CommonControlsWebApp into the three other projects does not update their files in the solution explorer. I would have to 'add exting items' all in all three WebApps when a file is added or renamed in CommonControls.

Changing to the Web Site model would remedy this, but I am worried about the compile time for WebApp1-3 if I do this.

'Add as link' does not work for directories.

I could use Subversion to share the files between the projects, but i believe that this would require me to check the files in and out again all the time if I am developing a user control that I have to test through one of the WebApps.

Can it really be true that ASP.NET does not have a good solution for this? How are you guys organizing large web applications?

Edit: Thanks a lot for all the answers. I am going to copy my user controls with a build event for now, and then see if we have time to refactor them into server controls.

LastEditorDisplayName: Jan Aagaard

OwnerDisplayName: Jake


问:
How to use Microsoft.Win32.Registry.OpenSubKey to go directly to a particular key?
Now this is a simple question. It should be clearly documented in MSDN. I looked but I couldn't find it. The only thing I got was that I had to open subkey after subkey after subkey to get to the particular key I'm interested in.

Surely there is a more direct method to access a key 3 levels deep. What is it?

I've already tried

```<code>RegistryKey reg = Registry.LocalMachine;
reg.OpenSubKey(@"Software\Microsoft", true);  // reg is still HKLM !
</code>```

and

```<code>reg.OpenSubKey(@"Software\Microsoft\", true); // reg is still HKLM !
</code>```

答:
OpenSubKey returns a new RegistryKey object :

```<code>reg = reg.OpenSubKey(@"Software\Microsoft", true); // Will work or
var sub = reg.OpenSubKey(@"Software\Microsoft", true);
</code>```

ContentLicense: CC BY-SA 3.0

Body:
Now this is a simple question. It should be clearly documented in MSDN. I looked but I couldn't find it. The only thing I got was that I had to open subkey after subkey after subkey to get to the particular key I'm interested in.

Surely there is a more direct method to access a key 3 levels deep. What is it?

I've already tried

RegistryKey reg = Registry.LocalMachine;
reg.OpenSubKey(@"Software\Microsoft", true);  // reg is still HKLM !

and

reg.OpenSubKey(@"Software\Microsoft\", true); // reg is still HKLM !

Body:
OpenSubKey returns a new RegistryKey object :

reg = reg.OpenSubKey(@"Software\Microsoft", true); // Will work or
var sub = reg.OpenSubKey(@"Software\Microsoft", true);


问:
Because calendar depends on table_calendar >=2.3.0 which requires Flutter SDK version >=1.17.0, version solving failed
I have this error while running pubget table_calendar (^3.0.3) in my Calendar app. Here is my pubspec file</p>
```<code>name: calendar
description: A new Flutter project.
version: 1.0.0+1
environment:
  sdk: ">=2.12.0 <3.0.0"
dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  table_calendar: ^3.0.3

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^1.0.0
flutter:
uses-material-design: true
</code>```

答: Seems weird that you are trying to do a pub get on table_calendar: ^3.0.3 but the error is being thrown trying to get table_calendar >= 2.3.0. I would look around that area.</p>

Body:
I have this error while running pubget table_calendar (^3.0.3) in my Calendar app. Here is my pubspec file

name: calendar
description: A new Flutter project.
version: 1.0.0+1
environment:
  sdk: ">=2.12.0 <3.0.0"
dependencies:
  flutter:
    sdk: flutter
  cupertino_icons: ^1.0.2
  table_calendar: ^3.0.3

dev_dependencies:
  flutter_test:
    sdk: flutter
  flutter_lints: ^1.0.0
flutter:
uses-material-design: true


问:
VBO for tilemap (draw order and slanted aerial 2D)
I want to draw a tilemap in a (ANSI C, C99 cannot be used due to windows compatibility) game that uses GL for accelerated graphics, although the game is a top-down 2D perspective using textured quads.
The popular opinion for handling a timemap seems to use a GL vertex buffer object, which I am about to write. However, I realized I want some tiles to go a little beyond vertical bounds, faking a slanted aerial view. That will make whatever is directly above the block to be partially covered by the tile.
If I use a VBO here, I will need to draw the entire tilemap in one sitting. Meaning that any object I draw afterwards will be directly on top of the tilemap.

What would be the sanest approach to this problem? Should I draw the tilemap first, then the entities (players/enemies) and then the excess vertical space so they cover the entities, and finally the effects that display over both? (such as shots, explosions, etcetera). But this would give me the issue of shots not being covered by terrain, and if I change the order, terrain covering large explosions awkwardly.
Alternatively I can sort all visual objects and draw them in a top-down fashion, but that would mean I need to change textures often, as sorting by texture wouldn't help too much in this specific case.

As well, I want to be able to modify the colors of every individual vertex in the grid in a dynamic way, so that entities can cast colors into the map. From what I am understanding, the way to achieve this would be with a vertex shader. Is this correct?

EDIT: A last thing. If I draw a VBO like that tilemap that is larger than the screen,by translating,  does GL automatically cull out-of-view faces or do I need to reform the VBO every time I move the "camera"?

答:
I actually answered my own question. I needed to separate the map in two: blocks that have empty space directly on top, and then the rest. Effects will be drawn in two passes, "regular" and "top" "layer"

I feel pretty bad about having an useless question lying around though, so if some admin needs to purge it, please go ahead.


问:
kafka consumer topic offset not able to apply latest issue
If the program subscribing to the kafka topic is terminated and re-executed, the latest offset does not seem to be applied.
The previously called data is output again.</p>
```<code>ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG = false;
ConsumerConfig.MAX_POLL_RECORDS_CONFIG = 1;
ConsumerConfig.AUTO_OFFSET_RESET_CONFIG = latest;
</code>```

答: The reset config only applies if the consumer group doesn't exist yet. If you always want the latest message, you'll need to call seekToEnd()

Body:
If the program subscribing to the kafka topic is terminated and re-executed, the latest offset does not seem to be applied.
The previously called data is output again.

ConsumerConfig.ENABLE_AUTO_COMMIT_CONFIG = false;
ConsumerConfig.MAX_POLL_RECORDS_CONFIG = 1;
ConsumerConfig.AUTO_OFFSET_RESET_CONFIG = latest;


问:
Question about taos shell use source command
What is the maximum file size for taos source 'filename' command? For my project, the data file is huge and I'm afraid of being interrupted within data transferring.</p>

答: In general, there is no limitation in TDengine, but I think you should take care of your system hardware capabilities.</p>


问:
submit button just refreshes php
```<code><form method="POST">
    <div class="form-outline form-white mb-4">
  <input type="password" name="password" class="form-control" required/>
  <label class="form-label" for="form">Pass</label>
</div>
    <button type="Submit" value="send" class="btn transparent btn-block" style="color: white;">Submit</button>
  </form>

   if (isset($_POST['submit'])) {
      $password=$_POST['password'];

      if ($password=='password') {
        header("location:ari.html");
        exit();
      }
      else
        echo "Incorrect.";
    }
</code>```

I'm beginning php currently and I'm trying to use a login method, but whenever I press my submit button my code refreshes and doesn't move onto the next page I indicated. (location:ari.html)
If I could get help on what I did wrong that would be great thanks.

答:
```<code><form method="POST" >
    <div class="form-outline form-white mb-4">
  <input type="password" name="password" class="form-control" required/>
  <label class="form-label" for="form">Pass</label>
</div>
    <button type="Submit" name="submit" value="send" class="btn transparent btn-block" style="color: white;">Submit</button>
  </form>
<?php
   if (isset($_POST['submit'])) {
    echo $password=$_POST['password']=='password'?header("location:ari.html"):"Incorrect.";
}
?>
</code>```

have updated this code and working fine for me...hope u got the answer

Title: submit button just refreshes php

Body:
<form method="POST">

  <input type="password" name="password" class="form-control" required/>
  Pass

    <button type="Submit" value="send" class="btn transparent btn-block" style="color: white;">Submit</button>
  </form>

   if (isset($_POST['submit'])) {
      $password=$_POST['password'];

      if ($password=='password') {
        header("location:ari.html");
        exit();
      }
      else
        echo "Incorrect.";
    }

I'm beginning php currently and I'm trying to use a login method, but whenever I press my submit button my code refreshes and doesn't move onto the next page I indicated. (location:ari.html)
If I could get help on what I did wrong that would be great thanks.

Body:
<form method="POST" >
    <div class="form-outline form-white mb-4">
  <input type="password" name="password" class="form-control" required/>
  <label class="form-label" for="form">Pass</label>
</div>
    <button type="Submit" name="submit" value="send" class="btn transparent btn-block" style="color: white;">Submit</button>
  </form>
<?php
   if (isset($_POST['submit'])) {
    echo $password=$_POST['password']=='password'?header("location:ari.html"):"Incorrect.";
}
?>

have updated this code and working fine for me...hope u got the answer


问:
Kubernetes: Not able to communicate within two services (different pod, same namespace)
I am not able to communicate between two services.

post-deployment.yaml

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: python-data-deployment
  labels:
spec:
  replicas: 1
  selector:
   matchLabels:
    app: python-web-selector
    tier: backend
  template:
   metadata:
     labels:
       app: python-web-selector
       tier: backend
   spec:
    containers:
    - name: python-web-pod
      image: sakshiarora2012/python-backend:v10
      ports:
      - containerPort: 5000
</code>```

post-deployment2.yaml

```<code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: python-data-deployment2
  labels:
spec:
  replicas: 1
  selector:
   matchLabels:
    app: python-web-selector2
    tier: backend
  template:
   metadata:
     labels:
       app: python-web-selector2
       tier: backend
   spec:
    containers:
    - name: python-web-pod2
      image: sakshiarora2012/python-backend:v8
      ports:
      - containerPort: 5000
</code>```

post-service.yml

```<code>apiVersion: v1
kind: Service
metadata:
  name: python-data-service
spec:
  selector:
   app: python-web-selector
   tier: backend
  ports:
      - port: 5000
        nodePort: 30400
  type: NodePort
</code>```

post-service2.yml

```<code>apiVersion: v1
kind: Service
metadata:
  name: python-data-service2
spec:
  selector:
   app: python-web-selector2
   tier: backend
  ports:
      - port: 5000
  type: ClusterIP
</code>```

When I go and try to ping from 1 container to another, it is not able to ping

```<code>root@python-data-deployment-7bd65dc685-htxmj:/project# ping python-data-service.default.svc.cluster.local
PING python-data-service.default.svc.cluster.local (10.107.11.236) 56(84) bytes of data.
^C
--- python-data-service.default.svc.cluster.local ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 139ms
</code>```

If I see dns entry it is showing

```<code>sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl exec -i -t dnsutils -- nslookup  python-data-service
Server:     10.96.0.10
Address:    10.96.0.10#53

Name:   python-data-service.default.svc.cluster.local
Address: 10.107.11.236

sakshiarora@Sakshis-MacBook-Pro Student_Registration %
sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl exec -i -t dnsutils -- nslookup  python-data-service2
Server:     10.96.0.10
Address:    10.96.0.10#53

Name:   python-data-service2.default.svc.cluster.local
Address: 10.103.97.40

sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl get pod -o wide
NAME                                       READY   STATUS    RESTARTS   AGE     IP           NODE       NOMINATED NODE   READINESS GATES
dnsutils                                   1/1     Running   0          5m54s   172.17.0.9   minikube   <none>           <none>
python-data-deployment-7bd65dc685-htxmj    1/1     Running   0          47m     172.17.0.6   minikube   <none>           <none>
python-data-deployment2-764744b97d-mc9gm   1/1     Running   0          43m     172.17.0.8   minikube   <none>           <none>
python-db-deployment-d54f6b657-rfs2b       1/1     Running   0          44h     172.17.0.7   minikube   <none>           <none>

sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl describe svc python-data-service
Name:                     python-data-service
Namespace:                default
Labels:                   <none>
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"python-data-service","namespace":"default"},"spec":{"ports":[{"no...
Selector:                 app=python-web-selector,tier=backend
Type:                     NodePort
IP:                       10.107.11.236
Port:                     <unset>  5000/TCP
TargetPort:               5000/TCP
NodePort:                 <unset>  30400/TCP
Endpoints:                172.17.0.6:5000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>
sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl describe svc python-data-service2
Name:              python-data-service2
Namespace:         default
Labels:            <none>
Annotations:       kubectl.kubernetes.io/last-applied-configuration:
                     {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"python-data-service2","namespace":"default"},"spec":{"ports":[{"p...
Selector:          app=python-web-selector2,tier=backend
Type:              ClusterIP
IP:                10.103.97.40
Port:              <unset>  5000/TCP
TargetPort:        5000/TCP
Endpoints:         172.17.0.8:5000
Session Affinity:  None
Events:            <none>
</code>```

sakshiarora@Sakshis-MacBook-Pro Student_Registration %

I think if in DNS table it show if of range 172,17.0.X then it will work, but not sure why it is not showing in dns entry, Any pointers?

答:
Are you able to connect to your pods maybe try port-forward to see if you can connect & then check the connectivity in two pods.
Last check if there is default deny network policy set there - maybe you have some restrictions at network level.</p>
```<code>kubectl get networkpolicy -n <namespace>
</code>```

Body:
I am not able to communicate between two services.

post-deployment.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: python-data-deployment
  labels:
spec:
  replicas: 1
  selector:
   matchLabels:
    app: python-web-selector
    tier: backend
  template:
   metadata:
     labels:
       app: python-web-selector
       tier: backend
   spec:
    containers:
    - name: python-web-pod
      image: sakshiarora2012/python-backend:v10
      ports:
      - containerPort: 5000

post-deployment2.yaml

apiVersion: apps/v1
kind: Deployment
metadata:
  name: python-data-deployment2
  labels:
spec:
  replicas: 1
  selector:
   matchLabels:
    app: python-web-selector2
    tier: backend
  template:
   metadata:
     labels:
       app: python-web-selector2
       tier: backend
   spec:
    containers:
    - name: python-web-pod2
      image: sakshiarora2012/python-backend:v8
      ports:
      - containerPort: 5000

post-service.yml

apiVersion: v1
kind: Service
metadata:
  name: python-data-service
spec:
  selector:
   app: python-web-selector
   tier: backend
  ports:
      - port: 5000
        nodePort: 30400
  type: NodePort

post-service2.yml

apiVersion: v1
kind: Service
metadata:
  name: python-data-service2
spec:
  selector:
   app: python-web-selector2
   tier: backend
  ports:
      - port: 5000
  type: ClusterIP

When I go and try to ping from 1 container to another, it is not able to ping

root@python-data-deployment-7bd65dc685-htxmj:/project# ping python-data-service.default.svc.cluster.local
PING python-data-service.default.svc.cluster.local (10.107.11.236) 56(84) bytes of data.
^C
--- python-data-service.default.svc.cluster.local ping statistics ---
7 packets transmitted, 0 received, 100% packet loss, time 139ms

If I see dns entry it is showing

sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl exec -i -t dnsutils -- nslookup  python-data-service
Server:     10.96.0.10
Address:    10.96.0.10#53

Name:   python-data-service.default.svc.cluster.local
Address: 10.107.11.236

sakshiarora@Sakshis-MacBook-Pro Student_Registration %
sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl exec -i -t dnsutils -- nslookup  python-data-service2
Server:     10.96.0.10
Address:    10.96.0.10#53

Name:   python-data-service2.default.svc.cluster.local
Address: 10.103.97.40

sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl get pod -o wide
NAME                                       READY   STATUS    RESTARTS   AGE     IP           NODE       NOMINATED NODE   READINESS GATES
dnsutils                                   1/1     Running   0          5m54s   172.17.0.9   minikube   <none>           <none>
python-data-deployment-7bd65dc685-htxmj    1/1     Running   0          47m     172.17.0.6   minikube   <none>           <none>
python-data-deployment2-764744b97d-mc9gm   1/1     Running   0          43m     172.17.0.8   minikube   <none>           <none>
python-db-deployment-d54f6b657-rfs2b       1/1     Running   0          44h     172.17.0.7   minikube   <none>           <none>

sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl describe svc python-data-service
Name:                     python-data-service
Namespace:                default
Labels:                   <none>
Annotations:              kubectl.kubernetes.io/last-applied-configuration:
                            {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"python-data-service","namespace":"default"},"spec":{"ports":[{"no...
Selector:                 app=python-web-selector,tier=backend
Type:                     NodePort
IP:                       10.107.11.236
Port:                     <unset>  5000/TCP
TargetPort:               5000/TCP
NodePort:                 <unset>  30400/TCP
Endpoints:                172.17.0.6:5000
Session Affinity:         None
External Traffic Policy:  Cluster
Events:                   <none>
sakshiarora@Sakshis-MacBook-Pro Student_Registration % kubectl describe svc python-data-service2
Name:              python-data-service2
Namespace:         default
Labels:            <none>
Annotations:       kubectl.kubernetes.io/last-applied-configuration:
                     {"apiVersion":"v1","kind":"Service","metadata":{"annotations":{},"name":"python-data-service2","namespace":"default"},"spec":{"ports":[{"p...
Selector:          app=python-web-selector2,tier=backend
Type:              ClusterIP
IP:                10.103.97.40
Port:              <unset>  5000/TCP
TargetPort:        5000/TCP
Endpoints:         172.17.0.8:5000
Session Affinity:  None
Events:            <none>

sakshiarora@Sakshis-MacBook-Pro Student_Registration %

I think if in DNS table it show if of range 172,17.0.X then it will work, but not sure why it is not showing in dns entry, Any pointers?

Body:
Are you able to connect to your pods maybe try port-forward to see if you can connect & then check the connectivity in two pods.
Last check if there is default deny network policy set there - maybe you have some restrictions at network level.

kubectl get networkpolicy -n <namespace>


问:
Specifying Tf.exe and MsBuild version in CC.Net
The problem

I am porting a build to a newer version of CC.Net (from 1.4.4 to a very recent version of 1.6).  Previously the build mixed <msbuild /> tags with <exec /> tags that call batch files with tf.exe commands in them.

The build must have relied on the source control version being the same between the msbuild and tf.exe commands, because now I get an error on the tf.exe command:

Unable to determine the workspace.

When I launch a command prompt, with runas as the same user the service is using, and call the same command the batch file used (from the same directory), I get the same error.

However if I launch a Visual Studio 2010 command prompt, with runas, and call that command (from the same directory), I don't get the error.

This also makes sense, because the %UserProfile%\Local Settings\Application Data\Microsoft\Team Foundation\3.0\Cache\VersionControl.config file has the workspace mapping, but the ...\1.0\Cache\VersionControl.config file does not.

The solution I'd like to try

I can't simply change the PATH for the batch file because it actually needs to build against an older version of Visual Studio, due to licensing.

I think I could solve this by specifying the TFS/msbuild version used with the <msbuild /> tag.  But I'm not sure how to go about this.  I think it would be some sort of server configuration, but I haven't found anything about this in the docs.

My question is: How do I specify the version of TFS that Cruise Control uses for <msbuild /> tags?  Or is there another way to solve this?

答:
I won't accept this solution, in case people have other solutions (or can solve the problem I directly asked about), but here's how I ended up solving my problem:

I added a workspace sync task to the top of the build tasks:

```<code><tasks>
    <exec>
        <description>Sync the workspaces with the TFS server, for the version of TFS used in exec commands</description>
        <executable>Tf.exe</executable>
        <buildArgs>workspaces /s:$(TfsServer)</buildArgs>
    </exec>
</code>```

This works because in my scenario, I don't care about the versioning as much as I do about the workspaces getting out of sync.

Body:
I won't accept this solution, in case people have other solutions (or can solve the problem I directly asked about), but here's how I ended up solving my problem:

I added a workspace sync task to the top of the build tasks:

<tasks>
    <exec>
        <description>Sync the workspaces with the TFS server, for the version of TFS used in exec commands</description>
        <executable>Tf.exe</executable>
        <buildArgs>workspaces /s:$(TfsServer)</buildArgs>
    </exec>

This works because in my scenario, I don't care about the versioning as much as I do about the workspaces getting out of sync.


问:
How to programatically close NSPopover being used in Mac Menu bar app
Apologies as this is a beginner question.
I am using https://github.com/davidcaddy/MenuBarPopoverExample to create a simple menu bar app.

I have added a button in the viewController and connected it.

What would the command be to simply close the NSPopover (see commented section below)?

View Controller Code:

```<code>import Cocoa

class ViewController: NSViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override var representedObject: Any? {
        didSet {
        // Update the view, if already loaded.
        }
    }

    static func newInstance() -> ViewController {
        let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: nil)
        let identifier = NSStoryboard.SceneIdentifier("ViewController")

        guard let viewcontroller = storyboard.instantiateController(withIdentifier: identifier) as? ViewController else {
            fatalError("Unable to instantiate ViewController in Main.storyboard!")
        }
        return viewcontroller
    }

    @IBAction func closePopover(_ sender: Any) {
        print("close this popover")

        // what code would I put here??
       // closePopover(self)?

    }
}
</code>```

AppDeligate code (untouched from example):

```<code>import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

    let statusItem = NSStatusBar.system.statusItem(withLength:NSStatusItem.squareLength)
    let popover = NSPopover()
    var eventMonitor: EventMonitor?

    func applicationDidFinishLaunching(_ aNotification: Notification) {
        if let button = self.statusItem.button {
            button.image = NSImage(named: NSImage.Name("ExampleMenuBarIcon"))
            button.action = #selector(AppDelegate.togglePopover(_:))

            // Uncomment this to capture right mouse clicks, in addition to left clicks
            //
            // button.sendAction(on: [.leftMouseUp, .rightMouseUp])
        }

        self.popover.contentViewController = ViewController.newInstance()
        self.popover.animates = false

        self.eventMonitor = EventMonitor(mask: [.leftMouseDown, .rightMouseDown]) { [weak self] event in
            if let strongSelf = self, strongSelf.popover.isShown {
                strongSelf.closePopover(sender: event)
            }
        }
    }

    func applicationWillTerminate(_ aNotification: Notification) {
        // Insert code here to tear down your application
    }

    @objc func togglePopover(_ sender: NSStatusItem) {
        // if sendAction(on: [.leftMouseUp, .rightMouseUp]) is uncommented in applicationDidFinishLaunching
        // This can be used to check the type of the incoming mouse event
        //
        // let event = NSApp.currentEvent!
        // if event.type == NSEvent.EventType.rightMouseUp {
        //     print("Right Click")
        // }

        if self.popover.isShown {
            closePopover(sender: sender)
        }
        else {
            showPopover(sender: sender)
        }
    }

    func showPopover(sender: Any?) {
        if let button = self.statusItem.button {
            self.popover.show(relativeTo: button.bounds, of: button, preferredEdge: NSRectEdge.minY)
            self.eventMonitor?.start()
        }
    }

    func closePopover(sender: Any?) {
        self.popover.performClose(sender)
        self.eventMonitor?.stop()
    }
}
</code>```

I have tried every command I can find online and none of them allow me to close the popover programatically from within the ViewController.
I would appreciate any assistance you can provide.

答:
Just get the AppDelegate instance

```<code>@IBAction func closePopover(_ sender: Any) {
    let appDelegate = NSApp.delegate as! AppDelegate
    appDelegate.closePopover(self)
}
</code>```

Note: As the sender parameter is actually not being used you can omit it in the show and close functions

```<code>func showPopover()
</code>```

Body:
Apologies as this is a beginner question.
I am using https://github.com/davidcaddy/MenuBarPopoverExample to create a simple menu bar app.

I have added a button in the viewController and connected it.

What would the command be to simply close the NSPopover (see commented section below)?

View Controller Code:

import Cocoa

class ViewController: NSViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
    }

    override var representedObject: Any? {
        didSet {
        // Update the view, if already loaded.
        }
    }

    static func newInstance() -> ViewController {
        let storyboard = NSStoryboard(name: NSStoryboard.Name("Main"), bundle: nil)
        let identifier = NSStoryboard.SceneIdentifier("ViewController")

        guard let viewcontroller = storyboard.instantiateController(withIdentifier: identifier) as? ViewController else {
            fatalError("Unable to instantiate ViewController in Main.storyboard!")
        }
        return viewcontroller
    }

    @IBAction func closePopover(_ sender: Any) {
        print("close this popover")

        // what code would I put here??
       // closePopover(self)?

    }
}

AppDeligate code (untouched from example):

import Cocoa

@NSApplicationMain
class AppDelegate: NSObject, NSApplicationDelegate {

    let statusItem = NSStatusBar.system.statusItem(withLength:NSStatusItem.squareLength)
    let popover = NSPopover()
    var eventMonitor: EventMonitor?

    func applicationDidFinishLaunching(_ aNotification: Notification) {
        if let button = self.statusItem.button {
            button.image = NSImage(named: NSImage.Name("ExampleMenuBarIcon"))
            button.action = #selector(AppDelegate.togglePopover(_:))

            // Uncomment this to capture right mouse clicks, in addition to left clicks
            //
            // button.sendAction(on: [.leftMouseUp, .rightMouseUp])
        }

        self.popover.contentViewController = ViewController.newInstance()
        self.popover.animates = false

        self.eventMonitor = EventMonitor(mask: [.leftMouseDown, .rightMouseDown]) { [weak self] event in
            if let strongSelf = self, strongSelf.popover.isShown {
                strongSelf.closePopover(sender: event)
            }
        }
    }

    func applicationWillTerminate(_ aNotification: Notification) {
        // Insert code here to tear down your application
    }

    @objc func togglePopover(_ sender: NSStatusItem) {
        // if sendAction(on: [.leftMouseUp, .rightMouseUp]) is uncommented in applicationDidFinishLaunching
        // This can be used to check the type of the incoming mouse event
        //
        // let event = NSApp.currentEvent!
        // if event.type == NSEvent.EventType.rightMouseUp {
        //     print("Right Click")
        // }

        if self.popover.isShown {
            closePopover(sender: sender)
        }
        else {
            showPopover(sender: sender)
        }
    }

    func showPopover(sender: Any?) {
        if let button = self.statusItem.button {
            self.popover.show(relativeTo: button.bounds, of: button, preferredEdge: NSRectEdge.minY)
            self.eventMonitor?.start()
        }
    }

    func closePopover(sender: Any?) {
        self.popover.performClose(sender)
        self.eventMonitor?.stop()
    }
}

I have tried every command I can find online and none of them allow me to close the popover programatically from within the ViewController.
I would appreciate any assistance you can provide.

Body:
Just get the AppDelegate instance

@IBAction func closePopover(_ sender: Any) {
    let appDelegate = NSApp.delegate as! AppDelegate
    appDelegate.closePopover(self)
}

Note: As the sender parameter is actually not being used you can omit it in the show and close functions

func showPopover()


问:
C# Pong Game - problem with ball scripting
I was just copying a tutorial on YouTube on how to make the pong game and when it came to scripting the ball, there was an error for me but not the guy in the video.

I have no experience in C#, only Python. This is the error message:

Assets\Ball.cs(24,26): error CS0117: 'Random' does not contain a definition for 'range'

Anyone know what's wrong?

This is the script for it:

```<code>using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Ball : MonoBehaviour
{
    public float speed;
    public Rigidbody2D rb;

    //Start is called before the first frame update
    void Start()
    {
        Launch();
    }
    //Update is called once per frame
    void Update()
    {

    }
    private void Launch()

    {
        float x = Random.range(0,2) == 0 ? -1 : 1;
        float y = Random.range(0,2) == 0 ? -1 : 1;
        rb.velocity = new Vector2(speed * x, speed * y);
    }
}
</code>```

答: Here the script method just calls the "Launch()" method at initialization time, your "Lauch()" method is problematic, you can try to modify the "Random.range(0,2)" method to "Random.Range(0, 2)"</p>

Body:
I was just copying a tutorial on YouTube on how to make the pong game and when it came to scripting the ball, there was an error for me but not the guy in the video.

I have no experience in C#, only Python. This is the error message:

Assets\Ball.cs(24,26): error CS0117: 'Random' does not contain a definition for 'range'

Anyone know what's wrong?

This is the script for it:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Ball : MonoBehaviour
{
    public float speed;
    public Rigidbody2D rb;

    //Start is called before the first frame update
    void Start()
    {
        Launch();
    }
    //Update is called once per frame
    void Update()
    {

    }
    private void Launch()

    {
        float x = Random.range(0,2) == 0 ? -1 : 1;
        float y = Random.range(0,2) == 0 ? -1 : 1;
        rb.velocity = new Vector2(speed * x, speed * y);
    }
}


问:
Run SKLearnProcessor from AWS Lambda
I have below code written in AWS Sagemaker Jupyter Notebook. But I would like to run it from AWS Lambda (or AWS Step Functions) to enable automated execution.

There is a CreateProcessingJob in Step Functions and sagemaker.processing.ProcessingJob  in sagemaker API as well as create_processing_job in boto3 - that's the closest I could find...

Is it possible to achieve? What would be the point of creating all of these Sagemaker functionalities if they have to be executed manually from the notebook..?

```<code>import boto3
import sagemaker
from sagemaker import get_execution_role
from sagemaker.sklearn.processing import SKLearnProcessor
from sagemaker.processing import FrameworkProcessor
from sagemaker.processing import ProcessingOutput

region = boto3.session.Session().region_name
role = get_execution_role()

est_cls = sagemaker.sklearn.estimator.SKLearn
framework_version_str="0.23-1"

script_processor = FrameworkProcessor(
    role=role,
    instance_count=8,
    instance_type="ml.r5.8xlarge",
    volume_size_in_gb=120,
    max_runtime_in_seconds=432000,
    estimator_cls=est_cls,
    framework_version=framework_version_str
)

output_folder = 's3://bucket/out'

script_processor.run(
    code="preprocessing.py",
    source_dir = "code",
    outputs=[
        ProcessingOutput(output_name='preprocessed_data', source="/opt/ml/processing/train"),
    ],
    arguments=["--bucket", "bucket", "--subfolder", "Training_data/"],
)

script_processor_job_description = script_processor.jobs[-1].describe()
print(script_processor_job_description)
</code>```

答: It appears your code is written to trigger data preprocessing in Sagemaker, and this could be handled from Lambda via the invoke method. Secondly, SageMaker provides a robust toolset for managing various aspects of the machine learning workflow, and a preprocessing activity like this is not limited to manual runs from within a Jupyter notebook. If your objective is automation, I would recommend checking out SageMaker Pipelines to orchestrate and automate the workflows across each step of the machine learning process.</p>

Title: Run SKLearnProcessor from AWS Lambda

Body:
I have below code written in AWS Sagemaker Jupyter Notebook. But I would like to run it from AWS Lambda (or AWS Step Functions) to enable automated execution.

There is a CreateProcessingJob in Step Functions and sagemaker.processing.ProcessingJob  in sagemaker API as well as create_processing_job in boto3 - that's the closest I could find...

Is it possible to achieve? What would be the point of creating all of these Sagemaker functionalities if they have to be executed manually from the notebook..?

import boto3
import sagemaker
from sagemaker import get_execution_role
from sagemaker.sklearn.processing import SKLearnProcessor
from sagemaker.processing import FrameworkProcessor
from sagemaker.processing import ProcessingOutput

region = boto3.session.Session().region_name
role = get_execution_role()

est_cls = sagemaker.sklearn.estimator.SKLearn
framework_version_str="0.23-1"

script_processor = FrameworkProcessor(
    role=role,
    instance_count=8,
    instance_type="ml.r5.8xlarge",
    volume_size_in_gb=120,
    max_runtime_in_seconds=432000,
    estimator_cls=est_cls,
    framework_version=framework_version_str
)

output_folder = 's3://bucket/out'

script_processor.run(
    code="preprocessing.py",
    source_dir = "code",
    outputs=[
        ProcessingOutput(output_name='preprocessed_data', source="/opt/ml/processing/train"),
    ],
    arguments=["--bucket", "bucket", "--subfolder", "Training_data/"],
)

script_processor_job_description = script_processor.jobs[-1].describe()
print(script_processor_job_description)


问:
React - how to stop div onClick from changing sibling divs
I have 6 div elements that I want to be able to click one of and have the className change for just the div I've clicked on.  Currently, when I click on one div, ALL the div classNames change.  This idea came from a vanilla JS concept that I'm trying to convert into a React component.  I'm not sure where/what is going wrong, if anyone can tell me how to prevent the sibling divs' onClicks from being fired or if what I have is wrong fundamentally, I would be eternally grateful.  This is what I have so far:

```<code>import React, { useState} from "react";

import { Panels } from "../../components/index";
import { data } from "../../constants/index";
import "./gallery.css";

const Gallery = () => {
  const [isOpen, setIsOpen] = useState(false);

    const toggleOpen = () => {
        setIsOpen(!isOpen);
    };

  return (
    <div className="panels">
      {data.restaurants.map((restaurant, index) => (
        <div
          className={`panel panel${index} ${isOpen ? "open open-active" : ""}`}
          onClick={toggleOpen}
        >
          <Panels
            key={restaurant.name + index}
            description={restaurant.description}
            name={restaurant.name}
            website={restaurant.website}
          />
        </div>
      ))}
    </div>
  );
};

export default Gallery;
</code>```

This is my Panels Component code:

```<code>import React from "react";

const Panels = ({ name, description, website }) => {
    return (
  <div className="panel_text">
    <p>{description}</p>
    <p>{name}</p>
    <a href={website}>
      <p>Visit {name}</p>
    </a>
  </div>
)};

export default Panels;
</code>```

Aaaand this is my CSS code:

```<code>*, *:before, *:after {
    box-sizing: inherit;
}

.panels {
    min-height: 100vh;
    overflow: hidden;
    display: flex;
}

.panel, .panel_text {
    background: '#fff';
    box-shadow: inse 0 0 0 5px rgba(255, 255, 255, 0.1);
    color: var(--color-golden);
    text-align: center;
    align-items: center;
    transition:
        font-size 0.7s cubic-bezier(0.61, -0.19, 0.7, -0.11),
        flex 0.7s cubic-bezier(0.61, -0.19, 0.7, -0.11);
    font-size: 20px;
    background-size: cover;
    background-position: center;
    flex: 1;
    justify-content: center;
    display: flex;
    flex-direction: column;
}

.panel0 {background-image: url(../../assets/defuegocarousel.jpg);}
.panel1 {background-image: url(../../assets/HaydenslakeSz.jpg);}
.panel2 {background-image: url(../../assets/stonecliffSz.jpg);}
.panel3 {background-image: url(../../assets/shigezooutside.png);}
.panel4 {background-image: url(../../assets/southparkSz.jpeg);}
.panel5 {background-image: url(../../assets/lechonoutside.jpg);}

.panel > * {
    margin: 0;
    width: 100%;
    transition: transform 0.5s;
    flex: 1 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.panel > *:first-child {transform: translateY(-100%);}
.panel.open-active > *:first-child {transform: translateY(0); }
.panel > *:last-child { transform: translateY(100%); }
.panel.open-active > *:last-child {transform: translateY(0); }

.panel_text p, a {
    text-transform: uppercase;

}

.panel p:nth-child(2) {
    font-size: 4rem;
}

.panel.open {
    flex: 5;
    font-size: 40px;
}

@media only screen and (max-width: 600px) {
    .panel p {
        font-size: 1rem;
    }
}
</code>```

答:
your isOpen state is common between all your div's
you should specify a unique value for isOpen of each div

you can change your isOpen state to an object like this :

```<code>import React, { useState} from "react";

import { Panels } from "../../components/index";
import { data } from "../../constants/index";
import "./gallery.css";

const Gallery = () => {
  const [isOpen, setIsOpen] = useState({});

    const toggleOpen = (index) => {
        setIsOpen(prevState => {...prevState ,[index]:!(!!prevState[index]) });
    };

  return (
    <div className="panels">
      {data.restaurants.map((restaurant, index) => (
        <div
          className={`panel panel${index} ${isOpen[index] ? "open open-active" : ""}`}
          onClick={()=>toggleOpen(index)}
        >
          <Panels
            key={restaurant.name + index}
            description={restaurant.description}
            name={restaurant.name}
            website={restaurant.website}
          />
        </div>
      ))}
    </div>
  );
};

export default Gallery;
</code>```

Body:
I have 6 div elements that I want to be able to click one of and have the className change for just the div I've clicked on.  Currently, when I click on one div, ALL the div classNames change.  This idea came from a vanilla JS concept that I'm trying to convert into a React component.  I'm not sure where/what is going wrong, if anyone can tell me how to prevent the sibling divs' onClicks from being fired or if what I have is wrong fundamentally, I would be eternally grateful.  This is what I have so far:

import React, { useState} from "react";

import { Panels } from "../../components/index";
import { data } from "../../constants/index";
import "./gallery.css";

const Gallery = () => {
  const [isOpen, setIsOpen] = useState(false);

    const toggleOpen = () => {
        setIsOpen(!isOpen);
    };

  return (

      {data.restaurants.map((restaurant, index) => (
        <div
          className={`panel panel${index} ${isOpen ? "open open-active" : ""}`}
          onClick={toggleOpen}
        >
          <Panels
            key={restaurant.name + index}
            description={restaurant.description}
            name={restaurant.name}
            website={restaurant.website}
          />

      ))}

  );
};

export default Gallery;

This is my Panels Component code:

import React from "react";

const Panels = ({ name, description, website }) => {
    return (

{description}

{name}

Visit {name}

)};

export default Panels;

Aaaand this is my CSS code:

*, *:before, *:after {
    box-sizing: inherit;
}

.panels {
    min-height: 100vh;
    overflow: hidden;
    display: flex;
}

.panel, .panel_text {
    background: '#fff';
    box-shadow: inse 0 0 0 5px rgba(255, 255, 255, 0.1);
    color: var(--color-golden);
    text-align: center;
    align-items: center;
    transition:
        font-size 0.7s cubic-bezier(0.61, -0.19, 0.7, -0.11),
        flex 0.7s cubic-bezier(0.61, -0.19, 0.7, -0.11);
    font-size: 20px;
    background-size: cover;
    background-position: center;
    flex: 1;
    justify-content: center;
    display: flex;
    flex-direction: column;
}

.panel0 {background-image: url(../../assets/defuegocarousel.jpg);}
.panel1 {background-image: url(../../assets/HaydenslakeSz.jpg);}
.panel2 {background-image: url(../../assets/stonecliffSz.jpg);}
.panel3 {background-image: url(../../assets/shigezooutside.png);}
.panel4 {background-image: url(../../assets/southparkSz.jpeg);}
.panel5 {background-image: url(../../assets/lechonoutside.jpg);}

.panel > * {
    margin: 0;
    width: 100%;
    transition: transform 0.5s;
    flex: 1 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.panel > *:first-child {transform: translateY(-100%);}
.panel.open-active > *:first-child {transform: translateY(0); }
.panel > *:last-child { transform: translateY(100%); }
.panel.open-active > *:last-child {transform: translateY(0); }

.panel_text p, a {
    text-transform: uppercase;

}

.panel p:nth-child(2) {
    font-size: 4rem;
}

.panel.open {
    flex: 5;
    font-size: 40px;
}

@media only screen and (max-width: 600px) {
    .panel p {
        font-size: 1rem;
    }
}

Body:
your isOpen state is common between all your div's
you should specify a unique value for isOpen of each div

you can change your isOpen state to an object like this :

import React, { useState} from "react";

import { Panels } from "../../components/index";
import { data } from "../../constants/index";
import "./gallery.css";

const Gallery = () => {
  const [isOpen, setIsOpen] = useState({});

    const toggleOpen = (index) => {
        setIsOpen(prevState => {...prevState ,[index]:!(!!prevState[index]) });
    };

  return (
    <div className="panels">
      {data.restaurants.map((restaurant, index) => (
        <div
          className={`panel panel${index} ${isOpen[index] ? "open open-active" : ""}`}
          onClick={()=>toggleOpen(index)}
        >
          <Panels
            key={restaurant.name + index}
            description={restaurant.description}
            name={restaurant.name}
            website={restaurant.website}
          />
        </div>
      ))}
    </div>
  );
};

export default Gallery;


问:
Android Studio freezes on indexing
my project was working well but suddenly when I ran it on my phone, Android Studio freezes and I should stop it from task manager.
before this happens I installed "Geny motion" & "Virtual Box", but when the error occurred I uninstalled them. but the problem insisted.

Solutions I've tried

I uninstalled it and installed it again

I unplugged and plugged in my device

I disabled android indexing from setting

None of the above solutions worked.

答:
If the project is large & has a lot of modules, you might need to increase the  Allocated Heap Size for Android Studio.

Go to Edit Custom VM Options from Help menu and increase the value for -Xms and -Xmx

This is what I'm using

```<code>-Xms2048m
-Xmx8192m
-XX:MaxPermSize=2048m
-XX:ReservedCodeCacheSize=1024m
-XX:+UseCompressedOops
</code>```

Title: Android Studio freezes on indexing

Body:
If the project is large & has a lot of modules, you might need to increase the  Allocated Heap Size for Android Studio.

Go to Edit Custom VM Options from Help menu and increase the value for -Xms and -Xmx

This is what I'm using

-Xms2048m
-Xmx8192m
-XX:MaxPermSize=2048m
-XX:ReservedCodeCacheSize=1024m
-XX:+UseCompressedOops