Ubuntu Platform Bug Report: Offset argument contained a NaN value. 'dart:ui/painting.dart':

Steps to Reproduce

Execute flutter run on the code sample
Press 1 to select Linux Platform
Show up App window but got a exception

Expected results:
NO EXCEPTIONS log show up on console
Actual results:
EXCEPTIONS!

Code sample

import 'package:flutter/material.dart';

void main() {
  runApp(MaterialApp(
      theme: ThemeData(
          elevatedButtonTheme: ElevatedButtonThemeData(
        style: ElevatedButton.styleFrom(
          primary: Colors.blue,
        ),
      )),
      home: Scaffold(
        body: Center(child: Text('Test')),
      )));
}

Logs

An Observatory debugger and profiler on Linux is available at: http://<IP_ADDRESS>:39657/yyPXTy8X_4o=/

══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY ╞═════════════════════════════════════════════════════════
The following assertion was thrown during paint():
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

Either the assertion indicates an error in the framework itself, or we should provide substantially
more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was:
  MaterialApp MaterialApp:file:///home/zidi/Documents/ProjectPiao/PiaoPiao/piao_app/lib/main.dart:6:10

When the exception was thrown, this was the stack:
#2      _offsetIsValid (dart:ui/painting.dart:52:10)
#3      Canvas.drawParagraph (dart:ui/painting.dart:4466:12)
#4      TextPainter.paint (package:flutter/src/painting/text_painter.dart:642:12)
#5      BannerPainter.paint (package:flutter/src/widgets/banner.dart:147:18)
#6      RenderCustomPaint._paintWithPainter (package:flutter/src/rendering/custom_paint.dart:563:13)
#7      RenderCustomPaint.paint (package:flutter/src/rendering/custom_paint.dart:610:7)
#8      RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2409:7)
#9      PaintingContext.paintChild (package:flutter/src/rendering/object.dart:189:13)
#10     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#11     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2409:7)
#12     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:189:13)
#13     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#14     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2409:7)
#15     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:189:13)
#16     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#17     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2409:7)
#18     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:189:13)
#19     RenderProxyBoxMixin.paint (package:flutter/src/rendering/proxy_box.dart:140:15)
#20     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2409:7)
#21     PaintingContext.paintChild (package:flutter/src/rendering/object.dart:189:13)
#22     RenderView.paint (package:flutter/src/rendering/view.dart:209:15)
#23     RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2409:7)
#24     PaintingContext._repaintCompositedChild (package:flutter/src/rendering/object.dart:141:11)
#25     PaintingContext.repaintCompositedChild (package:flutter/src/rendering/object.dart:100:5)
#26     PipelineOwner.flushPaint (package:flutter/src/rendering/object.dart:979:29)
#27     RendererBinding.drawFrame (package:flutter/src/rendering/binding.dart:455:19)
#28     WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:883:13)
#29     RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:319:5)
#30     SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1143:15)
#31     SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1080:9)
#32     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure> (package:flutter/src/scheduler/binding.dart:863:7)
(elided 13 frames from class _AssertionError, class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)

The following RenderObject was being processed when the exception was fired: RenderCustomPaint#2a752:
  needs compositing
  creator: CustomPaint ← Banner ← CheckedModeBanner ← Title ← Directionality ←
    _LocalizationsScope-[GlobalKey#9d572] ← Semantics ← Localizations ← MediaQuery ←
    _MediaQueryFromWindow ← _FocusMarker ← Focus ← ⋯
  parentData: <none> (can use size)
  constraints: BoxConstraints(w=1280.0, h=720.0)
  size: Size(1280.0, 720.0)
This RenderObject had the following descendants (showing up to depth 5):
    child: RenderPointerListener#93936
      child: RenderAbsorbPointer#1027e
        child: RenderSemanticsAnnotations#327e0
          child: _RenderTheatre#cca13
            onstage 1: RenderIgnorePointer#af29b
            onstage 2: RenderSemanticsAnnotations#6cc21
            no offstage children
════════════════════════════════════════════════════════════════════════════════════════════════════
Activating Dart DevTools...                                         3.3s
The Flutter DevTools debugger and profiler on Linux is available at: http://<IP_ADDRESS>:9101?uri=http://<IP_ADDRESS>:39657/yyPXTy8X_4o=/
Lost connection to device.

Analyzing piao_app...

   info • Prefer const with constant constructors • lib/main.dart:14:13 • prefer_const_constructors
   info • Prefer const with constant constructors • lib/main.dart:15:15 • prefer_const_constructors
   info • Prefer const with constant constructors • lib/main.dart:15:29 • prefer_const_constructors

Machine Configurations
Kernel: Linux MYPCNAME 5.11.0-38-generic #42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
OS: Ubuntu 20.04.3 LTS
Type: 64-bits
Memory: 32GB
CPU: AMD 5900x
GPU: NVIDIA GTX 1080 Ti
GPU Driver: NVIDIA driver metapackage nvidia-driver-460

flutter doctor -v
[✓] Flutter (Channel stable, 2.5.3, on Ubuntu 20.04.3 LTS 5.11.0-38-generic, locale zh_CN.UTF-8)
    • Flutter version 2.5.3 at /home/zidi/Documents/SDK/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (3 周前), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup for detailed instructions).

[✓] VS Code (version 1.61.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.3 LTS 5.11.0-38-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 94.0.4606.81

! Doctor found issues in 2 categories.

Hi @generalzzd, thanks for filing the issue. I could not reproduce the issue. Can you please try running
flutter clean and re run the app and if the issue persists can you please verify if this issue occurs with new flutter project too by running
flutter create sample
flutter run

and also verify if this happens only on linux or other platforms too (web / Android).

flutter doctor -v
✓] Flutter (Channel stable, 2.5.3, on Ubuntu 20.04.3 LTS 5.11.0-38-generic, locale en_GB.UTF-8)
    • Flutter version 2.5.3 at /home/mahesh/flutter_sdk/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (3 weeks ago), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/mahesh/Android/Sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /snap/android-studio/115/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2020.3)
    • Android Studio at /snap/android-studio/115/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code
    • VS Code at /snap/code/current
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.3 LTS 5.11.0-38-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 95.0.4638.69

• No issues found!

@maheshmnj Hi, today I set up two brand new Ubuntu 20.04 LTS OS in VM in order to help you reproduce this bug.  First, install an English Version Ubuntu and download Flutter and do 'create sample' and run. It's running properly.  However, then I install a Chinese Version of Ubuntu and set up Flutter, and this bug show up. Probably, it causes by the Ubuntu Chinese Language pack. Reproduce methods are pretty straightforward that select a Chinese language pack when you install Ubuntu. Thanks.

@generalzzd Are you able to run the counter app (newly created flutter app) on the "Chinese version of Ubuntu"? Can you please share the link of the ISO file you installed which reproduces this issue?
Thanks

@maheshmnj Yes, I can run the counter app but the same exception show up as we mention before. (It can run but keep popping up exceptions!)
I download the Chinese Ubuntu ISO file from the official website. https://ubuntu.com/download/desktop
Please manually select the language pack when you install it. (DO NOT use VMware quick install)

In Chrome, the counter app shows a blank window.  Sometimes It works in Chrome, Sometimes it is blank. I do not have Android I cannot help you with it.

zidi@zidi-virtual-machine:~/文档/sample$ flutter run
Multiple devices found:
Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.3 LTS 5.11.0-40-generic
Chrome (web)    • chrome • web-javascript • Google Chrome 95.0.4638.69
[1]: Linux (linux)
[2]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 1

Launching lib/main.dart on Linux in debug mode...
Building Linux application...
Syncing files to device Linux...                                   100ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on Linux is available at:
http://<IP_ADDRESS>:37481/2VQtbJSKpTw=/

══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY
╞═════════════════════════════════════════════════════════
The following assertion was thrown during paint():
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

Either the assertion indicates an error in the framework itself, or we should
provide substantially
more information in this error message to help you determine and fix the
underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was:
  MaterialApp
  MaterialApp:file:///home/zidi/%E6%96%87%E6%A1%A3/sample/lib/main.dart:13:12

When the exception was thrown, this was the stack:
#2      _offsetIsValid (dart:ui/painting.dart:52:10)
#3      Canvas.drawParagraph (dart:ui/painting.dart:4466:12)
#4      TextPainter.paint
(package:flutter/src/painting/text_painter.dart:642:12)
#5      BannerPainter.paint (package:flutter/src/widgets/banner.dart:147:18)
#6      RenderCustomPaint._paintWithPainter
(package:flutter/src/rendering/custom_paint.dart:563:13)
#7      RenderCustomPaint.paint
(package:flutter/src/rendering/custom_paint.dart:610:7)
#8      RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2409:7)
#9      PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#10     RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:140:15)
#11     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2409:7)
#12     PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#13     RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:140:15)
#14     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2409:7)
#15     PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#16     RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:140:15)
#17     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2409:7)
#18     PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#19     RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:140:15)
#20     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2409:7)
#21     PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#22     RenderView.paint (package:flutter/src/rendering/view.dart:209:15)
#23     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2409:7)
#24     PaintingContext._repaintCompositedChild
(package:flutter/src/rendering/object.dart:141:11)
#25     PaintingContext.repaintCompositedChild
(package:flutter/src/rendering/object.dart:100:5)
#26     PipelineOwner.flushPaint
(package:flutter/src/rendering/object.dart:979:29)
#27     RendererBinding.drawFrame
(package:flutter/src/rendering/binding.dart:455:19)
#28     WidgetsBinding.drawFrame
(package:flutter/src/widgets/binding.dart:883:13)
#29     RendererBinding._handlePersistentFrameCallback
(package:flutter/src/rendering/binding.dart:319:5)
#30     SchedulerBinding._invokeFrameCallback
(package:flutter/src/scheduler/binding.dart:1143:15)
#31     SchedulerBinding.handleDrawFrame
(package:flutter/src/scheduler/binding.dart:1080:9)
#32     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure>
(package:flutter/src/scheduler/binding.dart:863:7)
(elided 13 frames from class _AssertionError, class _RawReceivePortImpl, class
_Timer, dart:async, and dart:async-patch)

The following RenderObject was being processed when the exception was fired:
RenderCustomPaint#f2b3a:
  needs compositing
  creator: CustomPaint ← Banner ← CheckedModeBanner ← Title ← Directionality ←
    _LocalizationsScope-[GlobalKey#78a53] ← Semantics ← Localizations ←
    MediaQuery ←
    _MediaQueryFromWindow ← _FocusMarker ← Focus ← ⋯
  parentData: <none> (can use size)
  constraints: BoxConstraints(w=1280.0, h=720.0)
  size: Size(1280.0, 720.0)
This RenderObject had the following descendants (showing up to depth 5):
    child: RenderPointerListener#38f83
      child: RenderAbsorbPointer#efd76
        child: RenderSemanticsAnnotations#17cec
          child: _RenderTheatre#04cb2
            onstage 1: RenderIgnorePointer#a12f8
            onstage 2: RenderSemanticsAnnotations#3c5ea
            no offstage children
════════════════════════════════════════════════════════════════════════════════
════════════════════

The Flutter DevTools debugger and profiler on Linux is available at:
http://<IP_ADDRESS>:9101?uri=http://<IP_ADDRESS>:37481/2VQtbJSKpTw=/

@generalzzd I found this similar issue https://github.com/flutter/flutter/issues/91379 and it looks like this is fixed on master channel. Could you please try switching to master channel and verify this by running
flutter channel master
flutter upgrade

Thanks

@maheshmnj  Switch to Flutter master channel. Still get exceptions and blank webpage. :(
Linux Desktop
zidi@zidi-virtual-machine:~/文档/flutter_master_test$ flutter upgrade
Flutter is already up to date on channel master
Flutter 2.6.0-12.0.pre.685 • channel master •
https://github.com/flutter/flutter.git
Framework • revision 7e05d103e9 (9 小时前) • 2021-11-10 19:43:02 -0500
Engine • revision 6abca28955
Tools • Dart 2.15.0 (build 2.15.0-285.0.dev)
zidi@zidi-virtual-machine:~/文档/flutter_master_test$ flutter create sample
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure
you trust this source!
Downloading package sky_engine...                                   4.3s
Downloading flutter_patched_sdk tools...                            9.5s
Downloading flutter_patched_sdk_product tools...                   37.2s
Downloading linux-x64 tools...                                     46.7s
Downloading linux-x64/font-subset tools...                          4.6s
Creating project sample...
Running "flutter pub get" in sample...                              4.1s
Wrote 87 files.

All done!
In order to run your application, type:

  $ cd sample
  $ flutter run

Your application code is in sample/lib/main.dart.

zidi@zidi-virtual-machine:~/文档/flutter_master_test$ cd sample
zidi@zidi-virtual-machine:~/文档/flutter_master_test/sample$ flutter run
Flutter assets will be downloaded from https://storage.flutter-io.cn. Make sure
you trust this source!
Downloading Web SDK...                                             65.6s
Downloading CanvasKit...                                           11.9s
Downloading linux-x64/linux-x64-flutter-gtk tools...               24.2s
Downloading linux-x64-profile/linux-x64-flutter-gtk tools...        18.6s
Downloading linux-x64-release/linux-x64-flutter-gtk tools...        14.8s
Multiple devices found:
Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.3 LTS 5.11.0-40-generic
Chrome (web)    • chrome • web-javascript • Google Chrome 95.0.4638.69
[1]: Linux (linux)
[2]: Chrome (chrome)
Please choose one (To quit, press "q/Q"): 1

Launching lib/main.dart on Linux in debug mode...
Building Linux application...
Syncing files to device Linux...                                   146ms

Flutter run key commands.
r Hot reload. 🔥🔥🔥
R Hot restart.
h List all available interactive commands.
d Detach (terminate "flutter run" but leave application running).
c Clear the screen
q Quit (terminate the application on the device).

💪 Running with sound null safety 💪

An Observatory debugger and profiler on Linux is available at:
http://<IP_ADDRESS>:37005/PkpMLp1Q7yY=/

══╡ EXCEPTION CAUGHT BY RENDERING LIBRARY
╞═════════════════════════════════════════════════════════
The following assertion was thrown during paint():
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

Either the assertion indicates an error in the framework itself, or we should
provide substantially
more information in this error message to help you determine and fix the
underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was:
  MaterialApp
  MaterialApp:file:///home/zidi/%E6%96%87%E6%A1%A3/flutter_master_test/sample/li
  b/main.dart:13:12

When the exception was thrown, this was the stack:
#2      _offsetIsValid (dart:ui/painting.dart:52:10)
#3      Canvas.drawParagraph (dart:ui/painting.dart:4596:12)
#4      TextPainter.paint
(package:flutter/src/painting/text_painter.dart:695:12)
#5      BannerPainter.paint (package:flutter/src/widgets/banner.dart:147:18)
#6      RenderCustomPaint._paintWithPainter
(package:flutter/src/rendering/custom_paint.dart:563:13)
#7      RenderCustomPaint.paint
(package:flutter/src/rendering/custom_paint.dart:610:7)
#8      RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2403:7)
#9      PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#10     RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:140:15)
#11     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2403:7)
#12     PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#13     RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:140:15)
#14     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2403:7)
#15     PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#16     RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:140:15)
#17     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2403:7)
#18     PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#19     RenderProxyBoxMixin.paint
(package:flutter/src/rendering/proxy_box.dart:140:15)
#20     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2403:7)
#21     PaintingContext.paintChild
(package:flutter/src/rendering/object.dart:189:13)
#22     RenderView.paint (package:flutter/src/rendering/view.dart:209:15)
#23     RenderObject._paintWithContext
(package:flutter/src/rendering/object.dart:2403:7)
#24     PaintingContext._repaintCompositedChild
(package:flutter/src/rendering/object.dart:141:11)
#25     PaintingContext.repaintCompositedChild
(package:flutter/src/rendering/object.dart:100:5)
#26     PipelineOwner.flushPaint
(package:flutter/src/rendering/object.dart:973:29)
#27     RendererBinding.drawFrame
(package:flutter/src/rendering/binding.dart:499:19)
#28     WidgetsBinding.drawFrame
(package:flutter/src/widgets/binding.dart:883:13)
#29     RendererBinding._handlePersistentFrameCallback
(package:flutter/src/rendering/binding.dart:363:5)
#30     SchedulerBinding._invokeFrameCallback
(package:flutter/src/scheduler/binding.dart:1145:15)
#31     SchedulerBinding.handleDrawFrame
(package:flutter/src/scheduler/binding.dart:1082:9)
#32     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure>
(package:flutter/src/scheduler/binding.dart:863:7)
(elided 13 frames from class _AssertionError, class _RawReceivePortImpl, class
_Timer, dart:async, and dart:async-patch)

The following RenderObject was being processed when the exception was fired:
RenderCustomPaint#88fcd:
  needs compositing
  creator: CustomPaint ← Banner ← CheckedModeBanner ← Title ← Directionality ←
    _LocalizationsScope-[GlobalKey#da8e0] ← Semantics ← Localizations ←
    MediaQuery ←
    _MediaQueryFromWindow ← _FocusMarker ← Focus ← ⋯
  parentData: <none> (can use size)
  constraints: BoxConstraints(w=1280.0, h=720.0)
  size: Size(1280.0, 720.0)
This RenderObject had the following descendants (showing up to depth 5):
    child: RenderPointerListener#f9fa4
      child: RenderAbsorbPointer#ca8ba
        child: RenderSemanticsAnnotations#cb525
          child: _RenderTheatre#0cfd9
            onstage 1: RenderIgnorePointer#ffd2d
            onstage 2: RenderSemanticsAnnotations#cd779
            no offstage children
════════════════════════════════════════════════════════════════════════════════
════════════════════
The Flutter DevTools debugger and profiler on Linux is available at:
http://<IP_ADDRESS>:9100?uri=http://<IP_ADDRESS>:37005/PkpMLp1Q7yY=/

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

Another exception was thrown: Offset argument contained a NaN value.

web

flutter doctor -v
zidi@zidi-virtual-machine:~/文档/flutter_master_test/sample$ flutter doctor -v
[✓] Flutter (Channel master, 2.6.0-12.0.pre.685, on Ubuntu 20.04.3 LTS
    5.11.0-40-generic, locale zh_CN.UTF-8)
    • Flutter version 2.6.0-12.0.pre.685 at /home/zidi/文档/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7e05d103e9 (9 小时前), 2021-11-10 19:43:02 -0500
    • Engine revision 6abca28955
    • Dart version 2.15.0 (build 2.15.0-285.0.dev)
    • Pub download mirror https://pub.flutter-io.cn
    • Flutter download mirror https://storage.flutter-io.cn

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from:
      https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK
      components.
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup
      for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[!] Android Studio (not installed)
    • Android Studio not found; download from
      https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/linux#android-setup
      for detailed instructions).

[✓] VS Code (version 1.62.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.3 LTS
      5.11.0-40-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 95.0.4638.69

! Doctor found issues in 2 categories.

Hi @generalzzd, changing the system language to chinese simplified, I was able to reproduce the issue. The app does run normally but the exception is thrown.

flutter doctor -v
✓] Flutter (Channel stable, 2.5.3, on Ubuntu 20.04.3 LTS 5.11.0-38-generic, locale zh_CN.UTF-8)
    • Flutter version 2.5.3 at /home/mahesh/flutter_sdk/stable
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 18116933e7 (4 周前), 2021-10-15 10:46:35 -0700
    • Engine revision d3ea636dc5
    • Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/mahesh/Android/Sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /snap/android-studio/115/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2020.3)
    • Android Studio at /snap/android-studio/115/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code
    • VS Code at /snap/code/current
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.3 LTS 5.11.0-38-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 95.0.4638.69

• No issues found!

[✓] Flutter (Channel master, 2.6.0-12.0.pre.689, on Ubuntu 20.04.3 LTS 5.11.0-38-generic, locale zh_CN.UTF-8)
    • Flutter version 2.6.0-12.0.pre.689 at /home/mahesh/flutter_sdk/master
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 51e7c618ab (3 小时前), 2021-11-11 01:23:05 -0500
    • Engine revision d5cadd28b0
    • Dart version 2.15.0 (build 2.15.0-285.0.dev)

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
    • Android SDK at /home/mahesh/Android/Sdk
    • Platform android-31, build-tools 31.0.0
    • Java binary at: /snap/android-studio/115/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
    • All Android licenses accepted.

[✓] Chrome - develop for the web
    • Chrome at google-chrome

[✓] Linux toolchain - develop for Linux desktop
    • clang version 10.0.0-4ubuntu1
    • cmake version 3.16.3
    • ninja version 1.10.0
    • pkg-config version 0.29.1

[✓] Android Studio (version 2020.3)
    • Android Studio at /snap/android-studio/115/android-studio
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] VS Code
    • VS Code at /snap/code/current
    • Flutter extension version 3.28.0

[✓] Connected device (2 available)
    • Linux (desktop) • linux  • linux-x64      • Ubuntu 20.04.3 LTS 5.11.0-38-generic
    • Chrome (web)    • chrome • web-javascript • Google Chrome 95.0.4638.69

• No issues found!

logs
Launching lib/main.dart on Linux in debug mode...
Connecting to VM Service at ws://<IP_ADDRESS>:37191/JQXjsoPDJB0=/ws

════════ Exception caught by rendering library ═════════════════════════════════
The following assertion was thrown during paint():
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

The relevant error-causing widget was
MaterialApp
When the exception was thrown, this was the stack
#2      _offsetIsValid (dart:ui/painting.dart:52:10)
#3      Canvas.drawParagraph (dart:ui/painting.dart:4466:12)
#4      TextPainter.paint
#5      BannerPainter.paint
#6      RenderCustomPaint._paintWithPainter
#7      RenderCustomPaint.paint
#8      RenderObject._paintWithContext
#9      PaintingContext.paintChild
#10     RenderProxyBoxMixin.paint
#11     RenderObject._paintWithContext
#12     PaintingContext.paintChild
#13     RenderProxyBoxMixin.paint
#14     RenderObject._paintWithContext
#15     PaintingContext.paintChild
#16     RenderProxyBoxMixin.paint
#17     RenderObject._paintWithContext
#18     PaintingContext.paintChild
#19     RenderProxyBoxMixin.paint
#20     RenderObject._paintWithContext
#21     PaintingContext.paintChild
#22     RenderView.paint
#23     RenderObject._paintWithContext
#24     PaintingContext._repaintCompositedChild
#25     PaintingContext.repaintCompositedChild
#26     PipelineOwner.flushPaint
#27     RendererBinding.drawFrame
#28     WidgetsBinding.drawFrame
#29     RendererBinding._handlePersistentFrameCallback
#30     SchedulerBinding._invokeFrameCallback
#31     SchedulerBinding.handleDrawFrame
#32     SchedulerBinding.scheduleWarmUpFrame.<anonymous closure>
(elided 13 frames from class _AssertionError, class _RawReceivePortImpl, class _Timer, dart:async, and dart:async-patch)
The following RenderObject was being processed when the exception was fired: RenderCustomPaint#c9ec5
RenderObject: RenderCustomPaint#c9ec5
    needs compositing
    parentData: <none> (can use size)
    constraints: BoxConstraints(w=1280.0, h=720.0)
    size: Size(1280.0, 720.0)
    child: RenderPointerListener#83b26
        needs compositing
        parentData: <none> (can use size)
        constraints: BoxConstraints(w=1280.0, h=720.0)
        size: Size(1280.0, 720.0)
        behavior: deferToChild
        listeners: down, up, cancel
        child: RenderAbsorbPointer#997f1
            needs compositing
            parentData: <none> (can use size)
            constraints: BoxConstraints(w=1280.0, h=720.0)
            size: Size(1280.0, 720.0)
            absorbing: false
            ignoringSemantics: implicitly false
            child: RenderSemanticsAnnotations#1e04e
                needs compositing
                parentData: <none> (can use size)
                constraints: BoxConstraints(w=1280.0, h=720.0)
                size: Size(1280.0, 720.0)
                child: _RenderTheatre#8e4cb
                    needs compositing
                    parentData: <none> (can use size)
                    constraints: BoxConstraints(w=1280.0, h=720.0)
                    size: Size(1280.0, 720.0)
                    skipCount: 0
                    textDirection: ltr
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

════════ Exception caught by rendering library ═════════════════════════════════
Offset argument contained a NaN value.
'dart:ui/painting.dart':
Failed assertion: line 52 pos 10: '<optimized out>'

The relevant error-causing widget was
MaterialApp
════════════════════════════════════════════════════════════════════════════════

cc @cbracken


WIP: Add a basic example on subclassing GtkApplication

wip cause it needs documentation, maybe also add subclassing for GtkApplicationWindow

I'll give this another round of reviews later but should generally be good now

Please squash the commits and remove the WIP part

Noticed a fun issue, I think it might be related to some recent regen.
While trying to run the app and hitting the close button, I get the following backtrace. This is on Fedora (gtk3-3.24.12-3.fc31.x86_64) , not sure how reproducible it is.
$ cargo run --bin basic_subclass
   Compiling gtk-rs-examples v0.0.1 (/home/alatiera/Projects/gtk-rs/examples)
    Finished dev [unoptimized + debuginfo] target(s) in 4.39s
     Running `target/debug/basic_subclass`
stuff created!
thread 'main' panicked at 'No parent class impl for "delete_event"', src/libcore/option.rs:1190:5
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:76
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:60
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:473
  11: std::panicking::continue_panic_fmt
             at src/libstd/panicking.rs:380
  12: rust_begin_unwind
             at src/libstd/panicking.rs:307
  13: core::panicking::panic_fmt
             at src/libcore/panicking.rs:85
  14: core::option::expect_failed
             at src/libcore/option.rs:1190
  15: core::option::Option<T>::expect
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libcore/option.rs:345
  16: <T as gtk::subclass::widget::WidgetImplExt>::parent_delete_event
             at /home/alatiera/.cargo/git/checkouts/gtk-b89af3a825b1a0bb/8b9e632/src/subclass/widget.rs:451
  17: gtk::subclass::widget::WidgetImpl::delete_event
             at /home/alatiera/.cargo/git/checkouts/gtk-b89af3a825b1a0bb/8b9e632/src/subclass/widget.rs:90
  18: gtk::subclass::widget::widget_delete_event
             at /home/alatiera/.cargo/git/checkouts/gtk-b89af3a825b1a0bb/8b9e632/src/subclass/widget.rs:924
  19: _gtk_marshal_BOOLEAN__BOXEDv
             at /usr/src/debug/gtk3-3.24.12-3.fc31.x86_64/gtk/gtkmarshalers.c:129
  20: <unknown>
  21: g_signal_emit_valist
  22: g_signal_emit
  23: gtk_widget_event_internal
             at /usr/src/debug/gtk3-3.24.12-3.fc31.x86_64/gtk/gtkwidget.c:7789
  24: gtk_widget_event_internal
             at /usr/src/debug/gtk3-3.24.12-3.fc31.x86_64/gtk/gtkwidget.c:7658
  25: gtk_main_do_event
             at /usr/src/debug/gtk3-3.24.12-3.fc31.x86_64/gtk/gtkmain.c:1819
  26: gtk_main_do_event
             at /usr/src/debug/gtk3-3.24.12-3.fc31.x86_64/gtk/gtkmain.c:1687
  27: send_delete_event
             at /usr/src/debug/gtk3-3.24.12-3.fc31.x86_64/gtk/gtkwindow.c:1327
  28: gdk_threads_dispatch
             at gdk.c:777
  29: <unknown>
  30: g_main_context_dispatch
  31: <unknown>
  32: g_main_context_iteration
  33: g_application_run
  34: <O as gio::application::ApplicationExtManual>::run
             at /home/alatiera/.cargo/git/checkouts/gio-a4b825b310a073b9/753f85b/src/application.rs:23
  35: basic_subclass::main
             at src/bin/basic_subclass.rs:180
  36: std::rt::lang_start::{{closure}}
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  37: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  38: std::panicking::try::do_call
             at src/libstd/panicking.rs:292
  39: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  40: std::panicking::try
             at src/libstd/panicking.rs:271
  41: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  42: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  43: std::rt::lang_start
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  44: main
  45: __libc_start_main
             at ../csu/libc-start.c:308
  46: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

Noticed a fun issue, I think it might be related to some recent regen.

Unrelated. The problem is that delete_event is NULL here and we currently don't handle that in the subclass bindings. We would have to check for which virtual methods it is valid to have NULL there and then what the default behaviour should be. That requires diving into the C code. I've done that for the things in gio and gstreamer, but nowhere else.
In this specific case, instead of panicking at that line it should return false here if it's NULL.

I am conflicted trying to decide where should methods be implemented. See bf625505511ed1905c53af3fff8cc818ab75b136
I lean towards the object itself as its more flexible overall.

I am conflicted trying to decide where should methods be implemented. See e345607
I lean towards the object itself as its more flexible overall.

So, sleeping on it there are couple advantages/disadvantages to each approach.

methods on the Private struct are explicitly seen as private as opposed to methods on the public object
Better ergonomics for implementing the method, can use self and avoids the indirect call to get the private struct that the method will most likely operate
Can still get to the gobject, in a similar way you get from the object to the Private stuct.

The disadvantages are the following:

in the callbacks you need to pass the public object as its the one that implements upgrade/downgrade methods, which ends up with a small dance for each callback invocation to get the private instance and then call the method
Need an indirect call to get the actual object in order to set/get properties.

I think I prefer the implementation of methods on the Private part of the object.

I think I prefer the implementation of methods on the Private part of the object.

:+1:

Anything else to be done in here? If not, please add comments in your code explaining what's going on. It's a code example after all, comments help people understanding what they're reading.

Looks good to me overall. Only thing missing is some comments inside the code in various places to explain what exactly these structs are and how they're used, what each piece of code is doing exactly, etc.
Also the bug in GTK about the parent virtual methods still needs to be fixed before merging this.

Looks like I am hitting another panic now, rebasing on top of https://github.com/gtk-rs/gtk/pull/921
thread 'main' panicked at 'assertion failed: ::glib::types::instance_of::<Self>(ptr as *const _)', /home/alatiera/.cargo/git/checkouts/gtk-c6c214f6fe1af4b7/ea45775/src/auto/widget.rs:53:1
stack backtrace:
   0: backtrace::backtrace::libunwind::trace
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/libunwind.rs:88
   1: backtrace::backtrace::trace_unsynchronized
             at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.37/src/backtrace/mod.rs:66
   2: std::sys_common::backtrace::_print_fmt
             at src/libstd/sys_common/backtrace.rs:76
   3: <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt
             at src/libstd/sys_common/backtrace.rs:60
   4: core::fmt::write
             at src/libcore/fmt/mod.rs:1030
   5: std::io::Write::write_fmt
             at src/libstd/io/mod.rs:1412
   6: std::sys_common::backtrace::_print
             at src/libstd/sys_common/backtrace.rs:64
   7: std::sys_common::backtrace::print
             at src/libstd/sys_common/backtrace.rs:49
   8: std::panicking::default_hook::{{closure}}
             at src/libstd/panicking.rs:196
   9: std::panicking::default_hook
             at src/libstd/panicking.rs:210
  10: std::panicking::rust_panic_with_hook
             at src/libstd/panicking.rs:473
  11: std::panicking::begin_panic
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/panicking.rs:407
  12: <gtk::auto::widget::Widget as glib::translate::FromGlibPtrBorrow<*mut gtk_sys::GtkWidget>>::from_glib_borrow
             at /home/alatiera/.cargo/git/checkouts/gtk-c6c214f6fe1af4b7/ea45775/<::glib::object::glib_object_wrapper macros>:167
  13: glib::translate::from_glib_borrow
             at /home/alatiera/.cargo/git/checkouts/glib-928cf7b282977403/faff657/src/translate.rs:1146
  14: gtk::subclass::window::window_set_focus
             at /home/alatiera/.cargo/git/checkouts/gtk-c6c214f6fe1af4b7/ea45775/src/subclass/window.rs:120
  15: g_cclosure_marshal_VOID__OBJECTv
  16: <unknown>
  17: g_signal_emit_valist
  18: g_signal_emit
  19: <unknown>
  20: <unknown>
  21: g_object_run_dispose
  22: gtk_main_do_event
  23: <unknown>
  24: <unknown>
  25: <unknown>
  26: g_main_context_dispatch
  27: <unknown>
  28: g_main_context_iteration
  29: g_application_run
  30: <O as gio::application::ApplicationExtManual>::run
             at /home/alatiera/.cargo/git/checkouts/gio-a4b825b310a073b9/920211b/src/application.rs:23
  31: basic_subclass::main
             at src/bin/basic_subclass.rs:213
  32: std::rt::lang_start::{{closure}}
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  33: std::rt::lang_start_internal::{{closure}}
             at src/libstd/rt.rs:49
  34: std::panicking::try::do_call
             at src/libstd/panicking.rs:292
  35: __rust_maybe_catch_panic
             at src/libpanic_unwind/lib.rs:80
  36: std::panicking::try
             at src/libstd/panicking.rs:271
  37: std::panic::catch_unwind
             at src/libstd/panic.rs:394
  38: std::rt::lang_start_internal
             at src/libstd/rt.rs:48
  39: std::rt::lang_start
             at /rustc/4560ea788cb760f0a34127156c78e2552949f734/src/libstd/rt.rs:64
  40: main
  41: __libc_start_main
  42: _start
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

14: gtk::subclass::window::window_set_focus

Yeah just like in Container, this should be a Option<&Widget> and not just a Widget

Added a couple comments for the tricky parts of g_application but the rest of the example assumes some prior knowledge about how GObject works in general. Though not sure where to elaborate more.

@alatiera Please run cargo fmt :)

@GuillaumeGomez Green :)

Thanks!


Assorted eth/erc20 fixes

Fix getTransactionInfo throwing confusing error: Cannot read property 'input' of null when tx is not known to node
Stop checking gas price during balance requests because it's going to get us rate limited
Gracefully handle web3 already known broadcast error
Broadcast transactions to blockbook node as backup measure

It breaks two tests. Please double check if implementation of isSweepable is correct and add mock for blockbook call

It breaks two tests. Please double check if implementation of isSweepable is correct and add mock for blockbook call

All tests now passing

All tests now passing


InDataset property

Hi all,
Kindly guide me with the syntax of how to set a global variable's 'IncludeInDataset' property to Yes in visual studio code.
Thanks

Hi Tina
The syntax is:
var
    [InDataSet]
    i : Integer;

/esben

Thank you @esbenk

But is this still needed?
In the attachment an AL project that extends the Customer table with a field Inactive . This field can only be changed by an action Toggle added to Customer Card and List. When Inactive = true,  the Name field on the the page should color red based on
        Style = Attention;
        StyleExpr = NameStyleSet;

NameStyle has been defined
var
        //[InDataSet]
        NameStyleSet : Boolean;

I thought I needed InDataSet (as you can see), but not using it (by out commenting) it still does the
job.
DeactivateCustomer.zip


⚠ Bofrost.de has degraded performance

In b420ca1, Bofrost.de (https://www.bofrost.de) experienced degraded performance:

HTTP code: 200
Response time: 856 ms

Resolved: Bofrost.de performance has improved in 1d97d1d after 8 minutes.


Suppress a DTD warning.

Is there any way to suppress the DTD warning / add an exception they way we do with JSLint?

My apologies I accidently added this question to your csslint repository. :-1:

yes you can add a .htmlhintrc file at the root of your project with "doctype-html5": false
see https://github.com/yaniswang/HTMLHint/wiki/Rules for more information


enum type inference loses refinement

Using a zod enum in an object degenerates to generic string.
const MyEnumType = z.enum(['a', 'b']);
type MyEnum = z.infer<typeof MyEnumType>;
type MyObject = {foo: MyEnum};

function testFunc() {
  let x: MyObject = {foo: 'a'};
  const parsed = MyEnumType.safeParse('a');
  if (parsed.success) {
    let y = {foo: parsed.data};
    x = y; // Type '{ foo: string; }' is not assignable to type 'MyObject'.
  }
}

As a workaround, I can use z.union([z.literal('a'), z.literal('b')]), but the verbosity is inconvenient.

Seems to be a weird quirk of TypeScript, not a Zod bug. Try this as a workaround:
const y = { foo: parsed.data } as const;

Potentially related https://github.com/microsoft/TypeScript/issues/36579.


Height percentage doesn't seem to work

When using height: "100%", I expect it to stretch to the bottom of the parent div. However, passing a percentage doesn't seem to do anything. Passing 100px or auto does work.
Playground:
https://codepen.io/dagorbattle/pen/ExNgoqO
I expect the height of the editor to fill to the red border. When the content gets larger than the 100%, then it should overflow the .se-wrapper-inner

@guido-visser Is it working properly in the vanilla JS version?

@guido-visser Is it working properly in the vanilla JS version?

The playground provided is a codepen of the Vanilla JS version

@guido-visser Should the editor screen be responsive display?

.sun-editor {
  height: 100%;
}
.sun-editor .se-wrapper {
  height: calc(100% - 94px - 16px); /* 100% - toolbar offsetHeight - bottom resizing bar offsetHeight */
}

Nice, thanks! That works. Still weird though that height: "100%" doesn't do this. But this fixes the issue, so I'll close this it.


which method to use for timeframe urls within a domain

if i use python to call cdx_toolkit, which method to use
iter or get
something like this
i want each url and its  first timestamp
http://web.archive.org/cdx/search/cdx?url=tiktok.com&collapse=urlkey&matchType=prefix&from=20241223&to=20241224

I have never used collapse= and don't know what it does.


tvOS- Context doesnt apply after autoplay next

Repro:

Open video within a context
Play video within the context
Wait until video play next
Second video start playing
Quit player
User lands on episode page within its show instead of context

Guessing this is the version on testflight? Live is a bit outdated.

It should not open a new page when video is auto played next. e.g. after queueing/ auto playing an entire series, user would end up with a lot of open pages. Had to click back multiple times to navigate back to home page

yes, 4.0.8

Done. Will be fixed in next build of 4.0.8


Vulnerability roundup 111: libtiff-4.3.0: 3 advisories [5.5]

search, files

[ ] CVE-2022-0561 CVSSv3=5.5 (nixos-21.11, nixos-unstable)
[ ] CVE-2022-0562 CVSSv3=5.5 (nixos-21.11, nixos-unstable)
[ ] CVE-2022-22844 CVSSv3=5.5 (nixos-21.11, nixos-unstable)

CVE details
CVE-2022-0561
Null source pointer passed as an argument to memcpy() function within TIFFFetchStripThing() in tif_dirread.c in libtiff versions from 3.9.0 to 4.3.0 could lead to Denial of Service via crafted TIFF file. For users that compile libtiff from sources, the fix is available with commit eecb0712.
CVE-2022-0562
Null source pointer passed as an argument to memcpy() function within TIFFReadDirectory() in tif_dirread.c in libtiff versions from 4.0 to 4.3.0 could lead to Denial of Service via crafted TIFF file. For users that compile libtiff from sources, a fix is available with commit 561599c.
CVE-2022-22844
LibTIFF 4.3.0 has an out-of-bounds read in _TIFFmemcpy in tif_unix.c in certain situations involving a custom tag and 0x0200 as the second word of the DE field.

Scanned versions: nixos-21.11: 2128d0aa28e; nixos-unstable: 5aaed40d22f.
Cc @alyssais

Fixes in #158180 #158361 #161295 and #161364


Licensing

A license should be provided to make clear what kind of usage is allowed. I would suggest a BSD or Apache license.
Btw, great plugin!

Thanks for the feedback. I never anticipated it would be quite so popular... I will look into this when I get a chance. In the meantime, please feel free to take, use and modify however you like.

Thank you.

Hello! I'm a developer of Datafari which is an advanced open source enterprise search solution and we find your code very interesting. We would have liked to use your code but we were restricted by the license because we can't use only Apache license or MIT license. These licenses allow the user to reuse this code freely without  restriction. So we advise you to use MIT because it's very simple and you have only to put :
/*
Copyright (c)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
or to put only this line: /*Licensed under the MIT license - http://opensource.org/licenses/MIT */
on the header of all the files that you want to provide this license. It's as simple as this.
Thank you for your hard work.

Project is now MIT licensed.


Translate English text to model input

Hello, thank you for amazing work! Couldn't understand how to translate English text (on which I want to inference your model) to torch tensor of tokens IDs. As far as I understand you firstly convert string to sequence of phonemas and then to their's indexes, am I right? Could you help me please how to do it?

Yeah, we follow a generalize format control via the egs/TEMPLATE/svs.sh where you can find a specified token generation stage. However for now, we do not support G2P conversion yet, so the ideal format I would suggest is to directly use the phonemized text

If you just want to use the existing model for inference, we have the example code in https://colab.research.google.com/github/SJTMusicTeam/svs_demo/blob/master/muskit_svs_realtime.ipynb of how we can use exisitng token list (then the problem would be to convert your current text into the phonemes that the vocabulary has)


Change '/' for DIRECTORY_SEPARATOR in helpers

There's any reason for use / insteand of php's DIRECTORY_SEPARATOR in helpers functions, for example public_path()?
It's not a problem, but I think is better use constant created for...

I guess because it's unneeded because when used in any php function calls, the separators are normalized before use.

Thanks for reply.
I was creating a function for standardize my own applications paths, working in windows I noticed this behavior (C:\path\to\laravel\public/uploads). So I just suggest it, Thanks ;)

Windows handles / separators quite good nowadays, so it's ok.


Generally, its to lose weight around min(5kg), max(7.5kg) by getting into Calisthenics and Boxing
Do you have a target date for this? If yes, write below
I want to achieve it in 1 month with a proper morning routine.
What will you achieve by completing this goal?
Planning out a training routine that I can do for 4-5 days a week.
Additional context
I've always been interested in Calisthenics and Boxing, but I've never been committed into doing it! Hopefully this will help me push myself a bit :>. After a month of getting into it, I think I'll be at a state where I am motivated and in shape on doing my former routine.

@chaaals I don't see the second day ;)

Seems Chaaals dropped off the task

I thought same


added flatc to third_party

this is to help assists people who are having problem running visualize.py

@googlebot I signed it!

This seems too large. Unassinging myself and assigning @gunan

This seems too large. Unassinging myself and assigning @gunan

Hi, sorry guys, I just built flatc and included it in third_party so that tensorflow/tensorflow/lite/tools/visualize.py can run smoothly.
It's my first pull request, not too sure if this is against tf standard practices.
Thanks for considering.

Afaik, you only need BUILD (and an optional workspace.bzl) and then add add the corresponding tf_http_archive, for example https://github.com/tensorflow/tensorflow/blob/235e88b123cbf742d7db91e37dd836e30bd6766d/tensorflow/workspace.bzl#L709-L718

As @mihaimaruseac expressed, you should just create a workspace.bzl entry.
We cannot copy the whole flatbuffers codebase into our own.


Fix random seed and add 'seed' as parameter

Description
I noticed the Random function wasn't working: It was random, but always in the same order.
We don't need to pass a Random object around, we simply need to set rand.Seed() once. Then all call to math/rand will be randomize.
It can be useful to set the seed directly to run the bot in a predictable fashion (ie. unit tests), so I added support for a -seed parameter.

Did you test it? :D

Yes, I tested the -seed. It works as advertised.


Is there a Self Organizing Network Like Hopfield in Brain.js?

I'd like to utilize something like a Hopfield SOM in javascript.
Is there something available in Brain.js or other javascript library?

I'd like to utilize something like a Hopfield SOM in javascript.

That'd be amazing!

Is there something available in Brain.js or other javascript library?

Not in brain.js.  https://www.npmjs.com/package/encog may have a Hopfield netowrk.


[SPARK-39038][CI] Skip reporting test results if triggering workflow was skipped

What changes were proposed in this pull request?
The "Report test results" workflow should be skipped when the triggering workflow completed with conclusion 'skipped'.
Why are the changes needed?
The "Report test results" workflow is triggered when either "Build and test" or "Build and test (ANSI)" complete. On fork repositories, workflow "Build and test (ANSI)" is always skipped.
The triggered "Report test results" workflow downloads artifacts from the triggering workflow and errors because there are none artifacts.
Does this PR introduce any user-facing change?
No
How was this patch tested?
In personal repo:

https://github.com/EnricoMi/spark/actions/runs/2231657986
triggered by https://github.com/EnricoMi/spark/actions/runs/2231657828

@HyukjinKwon here is the last bit to get forks free from scheduled errors

It used to look like this:

Now the triggered workflow is skipped if the triggering was skipped:

Merged to master.


[MRG] feat (agent and env) Bandits

This is a module for Bandits

@AleShi94 I added an example with some subplot and custom plots. Tell me what you think !


Accidentally  deleted the drop down menu.

Trying to remove the dribble icon and search bar, I deleted the full black drop down menu. Help needed

I fixed it


Address rarefaction depth evaluations in Qiime2 plugin

We could consider putting this figure directly on the process display page as well so that as the user adjusts the selected rarefaction depth they can have immediate feedback on the ramifications of what they're doing


Nginx Reverse Proxy for Peatio (caching)

Does anyone has proper working reverse proxy configuration for Nginx/Peatio source code to set caching for Peatio?
I am trying to find out how to enable caching for Peatio without data value lose (for example: in trades view).

i do run nginx cache in memory as:
mount -t tmpfs -o size=2G tmpfs /cache
ngnix conf:
`
server {
listen 80 default;
server_name _;
proxy_cache_path /cache levels=1:2 keys_zone=my_cache:10m max_size=2g inactive=60m use_temp_path=off;
location / {
proxy_pass https://yourpeatioserver;
proxy_cache my_cache;
proxy_cache_use_stale error timeout http_500 http_502 http_503 http_504;
proxy_pass_header Set-Cookie;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
`


#3371 add TOP limit support for Sybase and old SQL Server

A TOP limit will be added in the query for Sybase/SQL Server if the setting "Use SQL to limit fetch size" is enabled:

verified


Use wheel event only in mouseWheelInput.js

Previously, both mousewheel and DOMMouseScroll Events were used, the
latter of which is firefox specific. DOMMouseScroll shows problems when
two finger scrolling on Laptops. Newer browser versions all use the
standardized wheel event now, which should be the right thing to use
here.

Please check if the PR fulfills these requirements

[ ] The commit message follows our guidelines
[ ] Tests for the changes have been added (for bug fixes / features)
[ ] Docs have been added / updated (for bug fixes / features)

See this issue

@dannyrb

Coverage remained the same at 7.025% when pulling<PHONE_NUMBER>a351f2ace7bd4e8c85a2c0d4b06fc4 on talkdirty:master into fc136afb7e1082b993d53ffad91c7e23105a473e on cornerstonejs:master.

@talkdirty, I found a good resource for which versions of which browser vendors use which scroll events. It was included with a snippet of code to help normalize the event handling across browsers. I'll revisit this PR now that I have that information. I'll likely update our listener to normalize the event and well :+1:

That's great, thank you! Out of interest, could you link the resource you
found? Also let me know if you require any assistance for this.
Georg
On Fri 23. Nov 2018 at 20:42, Danny Brown<EMAIL_ADDRESS>wrote:

@talkdirty https://github.com/talkdirty, I found a good resource for
which versions of which browser vendors use which scroll events. It was
included with a snippet of code to help normalize the event handling across
browsers. I'll revisit this PR now that I have that information. I'll
likely update our listener to normalize the event and well 👍
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/cornerstonejs/cornerstoneTools/pull/644#issuecomment-441315386,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ARqswG3Smib2ct_QNljpVbsscoMqW6gHks5uyF3AgaJpZM4Xk1OT
.

https://github.com/facebookarchive/fixed-data-table/blob/master/src/vendor_upstream/dom/normalizeWheel.js

@talkdirty, alright. I've merged the fix for this to vNext. We have the option of backporting this to v2, but we would lose some browser support because I dropped listening for 'mousewheel', 'DOMMouseScroll' and instead only listen to wheel. I'm okay with doing that in vNext, because it's the next major release, and I'm okay with the breaking change there.
Whether we should do this for v2 isn't as cut and dry, even though I really, really hope no one is using cornerstone on <= IE 9 or older versions of evergreen browsers. I would be willing to backport it if @swederik gave the 👍
I believe #643 can be addressed with a non-breaking change, but I don't have the bandwidth to look into it.
tl;dr:

I will look at and merge any non-breaking solutions
If @swederik gives a 👍, I would spend the time to merge the vNext solution to this branch
I recommend waiting for vNext RC or bravely porting existing code to it now if this issue is plaguing you

I'll close this PR for now; feel free to continue discussion here, or on the related issue


[FEAT] Move files into directory

Hello again :)
I've added some functionality to the feature #12
Right now the following is working:

Move files from directory to directory
Move files from directory to root

Right now, the highlighting functionality is kind of "buggy". Maybe @haxzie can take a look at it.
It is because I basically store the dragging behaviour in the data part. I think it might be better when we store the "isDragging" state in the store and then apply the classes.

Thanks again @FlorianWoelki, I'll have a look at it and will update in this thread once I find a fix 🙌🏼✨

This works great. I just have one issue with the hightlight color. The hover option darkens the bg. You can use an accent color like blue which is more common in file explorers or a lighter grey color to match the theme. maybe add an option in the theme for this color if not already there .

Agreed with @prikeshsavla
Maybe @haxzie can add this in the refinement? :)

I've fixed the flashing issue by storing a Vuex state variable and updating the value of it whenever a different dragging element was hovered.
In addition, I've added a theme --drag-over-color and set it to #323543. It is a light gray used in the official Dracula specification.

Nice! The implementation looks good to me :+1: The drag over color being lighter makes it looks odd, I have played around with the colors and the --color-secondary actually looks okay. What do you think @FlorianWoelki ?

I personally think that both colors are great options. VS-Code uses a lighter one.
In the end, you will decide ;) Maybe @prikeshsavla can state his opionion.

@FlorianWoelki  Cool then :raised_hands: , I have changed the color to a lighter tone and added ability to move directories as well :+1:

@FlorianWoelki  Cool then :raised_hands: , I have changed the color to a lighter tone and added ability to move directories as well :+1:

Was out of loop for a while. I'll check it out and comment on it if I have
any suggestions.
On Fri, Jan 1, 2021, 7:27 PM Musthaq Ahamad<EMAIL_ADDRESS>wrote:

Merged #20 https://github.com/haxzie/snipp.in/pull/20 into master.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/haxzie/snipp.in/pull/20#event-4160972255, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AIKDLTQ4WXAT6JPU5RMI5WTSXXIGDANCNFSM4VNBJSUQ
.

Was out of loop for a while. I'll check it out and comment on it if I have
any suggestions.
On Fri, Jan 1, 2021, 7:27 PM Musthaq Ahamad<EMAIL_ADDRESS>wrote:

Merged #20 https://github.com/haxzie/snipp.in/pull/20 into master.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/haxzie/snipp.in/pull/20#event-4160972255, or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AIKDLTQ4WXAT6JPU5RMI5WTSXXIGDANCNFSM4VNBJSUQ
.


Set Shadow Height?

Hi, i cant figure out how to change the ImageView's (Shadow) height, can anyone please help me out?

private BottomBar bottomBar;
protected void onCreate(Bundle savedInstanceState) {
bottomBar = (BottomBar) findViewById(R.id.bottomBar);
bottomBar.findViewById(R.id.bb_bottom_bar_shadow).getLayoutParams().height= 4; // set height to 4dp.
}

@kikoololmdrxdd that would actually be 4Px not 4Dps, but, this is not something we are intending to change because this is only a "hack" for 4.4, if you are using API 21+ or above then you can just change the elevation of the BottomBar and it will override our default elevation. (Anyways there's a small fix for the shadow that will be going out in next release)

@kikoololmdrxdd @josefkorbel  the latest version is out, has some fixes for shadows


Material-Theme not working

I'm using Sublime Text 3 ( Build 3126 ) on Windows 10, the colour scheme works fine but when I add the theme option the UI looses it's colours and the sidebar goes black. Also things like search (CTRL + F) the buttons lose styling and don't work.

when I add the theme option

What theme option?

This theme option:
"theme": "Material-Theme.sublime-theme",

After saving your settings, what happens when you exit Sublime and restart the program? Is it still black?


After restricting the side menu from closing the selected menu option page navigates but from below the side menu.

As you can see the page navigates while the menu is open but the page navigates below the side menu.
How can I achieve opening of the page above the side menu while keeping the side menu open.
referring from previous issue

I'm afraid that it won't be possible to do that, since that's actually the default behavior of Ionic-Android. This component has nothing to do with the position of the side menu or the pages, that's just Ionic's default behavior:

You may try to change the z-index of the entire menu, but I guess it will cause some other issues since it's not supposed to work like that.

Thanks a lot again.
Your work has helped a lot of people here, I appreciate your work.
Take care and have a nice day ahead 😊
Regards,
Ishwar Kumar Prasad
On Wed, Apr 11, 2018 at 1:09 PM, Sebastián Ferreras <
<EMAIL_ADDRESS>wrote:

I'm afraid that it won't be possible to do that, since that's actually the
default behavior of Ionic-Android. This component has nothing to do with
the position of the side menu or the pages, that's just Ionic's default
behavior:
[image: sidemenu]
https://user-images.githubusercontent.com/17194770/38602768-03949b8e-3d6c-11e8-8463-c5f0055418cb.gif
You may try to change the z-index of the entire menu, but I guess it will
cause some other issues since it's not supposed to work like that.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/sebaferreras/Ionic3-MultiLevelSideMenu/issues/33#issuecomment-380358094,
or mute the thread
https://github.com/notifications/unsubscribe-auth/Aj4fJOUJ0j5wk27UuDxtFcNWjIJz3QU9ks5tnbM8gaJpZM4TPd2j
.

Thank you for your kind words @Vickypr1902 , and thank you for opening issues with questions and improvements!
Feel free to suggest any changes/improvements that you may need, and I'll do my best to add them to the component :)
Take care!


Unsafe Glob library because of inflight memory leak vulnerability

Hi, I use glob version v8.1.0. but a vulnerability is raised regarding the last inflight module version (v1.0.6), all versions are impacted). The vulnerability concerns memory leaks. Using an alternative as fast-glob does, Glob could be work fine without memory leak issue making Glob library safe. Is the glob patched version is plan ?
 "dependencies": {     "fs.realpath": "^1.0.0",     "inflight": "^1.0.4",     "inherits": "2",     "minimatch": "^5.0.1",     "once": "^1.3.0"   }
Thanks & Regards.

The current version is 10.3.3, and it does not use inflight.


Prepare for PHP 8.4

I've just manually triggered a test run and the PHP 8.4 build is currently failing for a variety of reasons.

Patchwork is not ready. I've opened an issue in the repo to discuss the solution direction for Patchwork.
BrainMonkey is affected by the PHP 8.4 deprecation of implicitly nullable parameters. PR to fix this upcoming. See #147
BrainMonkey is affected by the PHP 8.4 deprecation of passing E_USER_ERROR to trigger_error(). This needs investigation.

Thank you @jrfnl!
For point 3, I can give you more info.
TL;DR: We should probably use exceptions.
--
Patchwork can only replace functions that exist.
So when we use Brain Monkey to replace a function that doesn't exist, Brain Monkey first declares a dummy function that only triggers an error.
This means that the test will fail if the code under test executes the function without the developer setting expectations for it.
On every test, in tearDown, the Patchwork's replacement is reset, so the function goes back to being the one that triggers the error.
That means we have two possible cases in the next tests:

the code under tests doesn't use the function, and nothing bad happens
the code under tests uses the function. In that case, developers are forced to define expectations for it

Given this workflow, replacing trigger_error() with an exception will normally have the same result of making the test fail.
It currently uses trigger_error() to avoid having a too-generic expectation that "swallows" the Bran Monkey exception.
For example, image a test code like this:
public function testThatSomethingThrows()
{
   $this->expectException(Exception::class);

   $something = new Something();
   $something->execute();
}

In this case, if $something->execute() ends up throwing an exception because it calls a function for which there's no expectation set in Brain Monkey, right now, the test would fail because of trigger_error(), but if we move to use an exception, the test will pass just not for the reason the developers expect.
In summary, we have two options:

Keep using trigger_error() with another error constant. The risk here is that the test framework error handler would swallow such errors.
Move to exception, and the risk is the one described above

I think the latter is the lesser risk, so maybe we go for that.

Thanks for that explanation @gmazzap!

So when we use Brain Monkey to replace a function that doesn't exist, Brain Monkey first declares a dummy function that only triggers an error.

I've found the definition now (in a heredoc, which is why I didn't find it initially via (bleeding-edge) PHPCompatibility).

In summary, we have two options:

Keep using trigger_error() with another error constant. The risk here is that the test framework error handler would swallow such errors.
Move to exception, and the risk is the one described above

I think the latter is the lesser risk, so maybe we go for that.

I agree the second option is best, but would like to throw a variant of that in the mix:
What about adding a new Brain\Monkey\Expectation\Exception\UndefinedFunction extends Error exception ? While this may not be 100% semantically correct as Error is intended for PHP internal errors, it would reduce the chances of the exception unintentionally being caught by tests.
The only "problem" is that Error is a PHP 7.0 class, so this would need a dual definition with the class extending Exception in PHP 5.6.
This could be defined like the below and would then still be PSR4 compliant.
namespace Brain\Monkey\Expectation\Exception;

if (PHP_VERSION_ID >= 70000) {
    class UndefinedFunction extends \Error {}
} else {
    class UndefinedFunction extends \Exception {}
}

P.S.: the name of the new exception is, of course, open for discussion, my comment is mostly about the principle of how to handle this.

Hi @jrfnl and thanks for you input.
I'm unsure about extending Error. I would be fine on PHP 7+, but the conditional declaration looks complex and hard to justify.

If the risk model is people using too-generic expectations for generic, people can do $this->expectException(Throwable::class). Yes, this is even less expected than an expectation on Exception, but still, we do not eliminate all the risks.
What about running tests in a matrix? The same tests for the same codebase could sometimes be tested with Brain Monkey declaring the exception extending Error and sometimes Exception, which could cause "funny" inconsistencies.

So, all considered, I think the problems outweigh the benefits.
I guess that having some MissingFunctionExpectations extends Exception should be fine. We accept the low risk but have less complexity and consistency in matrix-based tests.

@gmazzap In that case, PR #149 should fix that part of the BrainMonkey PHP 8.4 compatibility issues.
So now it is just a waiting game for a new release of Patchwork. I've got a prelim patch for that ready, just waiting for the go-ahead on the PHP < 7.1 version drop.

And we're ready! :tada:
Patchwork just released version 2.2.0, which adds runtime support for PHP 8.4. V 2.2.0 does have a minimum PHP version of 7.1, but that shouldn't be an issue. When people install via Composer and are running on PHP < 7.1, Composer will just give them the last 2.1.x version, which will work fine on PHP < 7.1. And when people install via Composer with PHP 7.1+ (including PHP 8.4), they will get v 2.2.0 (or a later release once available) and that should take care of the PHP 8.4 compat issues.
@gmazzap I'd recommend tagging a new BrainMonkey release over the next few days to get the BrainMonkey specific PHP 8.4 patches out into the world. If people then update with --with-dependencies, they should automatically also get the new Patchwork release if they are running on PHP 7.1 or higher.

@gmazzap Ping ?

@jrfnl Sorry haven't feel well. Just to confirm, there's nothing else to do here just tag, right?

@gmazzap Nothing based on the last time I checked, though that is a few weeks back. Might be good to trigger a test run against the current PHP 8.4 just to verify, but I expect we should be good. I won't have time to double-check until the weekend.

Double-checked & confirmed.

Tests pass on PHP 8.4: https://github.com/Brain-WP/BrainMonkey/actions/runs/11327042323/job/31497270873
Also ran a scan with bleeding edge PHPCompatibility and that found no issues either.

As far as I'm concerned, nothing blocking the release anymore.

Thankd @jrfnl
Release is out https://github.com/Brain-WP/BrainMonkey/releases/tag/2.6.2


Proposal: Snapshot property matchers for render output

🚀 Feature Proposal
Property Matchers solve a common issue with snapshot tests, but only work for objects. The proposed feature is to extend that functionality to the rendered output html string as well.
Motivation
The same motivation as it was for object property matchers. Oftentimes, there are properties in rendered html that are non-deterministic. Randomly-generated ids for labels/form controls are a big one. Currently, the only way I know around this is to mock whatever is generating the id to make it deterministic, usually returning a constant value. This can be problematic though if you're using something like react-testing-library to query elements by their label text, since then all ids are identical and it's unclear which label corresponds to which input.
The ability to ignore these fields when deciding if a snapshot matches or not solves this issue.
Example
Similar to object property matchers
it('renders correctly', () => {
  const tree = renderer
    .create(<Link page="http://www.facebook.com">Facebook</Link>)
    .toJSON();
  expect(tree).toMatchSnapshot({
    for: expect.any(String),
    id: expect.any(String),
  });
});

// Snapshot
will check the matchers and pass `
<div>
  <label
    class="form__label color color--cod-gray"
    for=Any<string>
  >
  <input id=Any<string> />
</div>
`;

Pitch
This would make snapshot testing easier for some pretty common cases that currently cause difficulty.

The way property matchers are implemented today is not transferable to this feature request. It currently replaces the given fields with an asymmetric matcher, then passes through serialisation. I think you'd have to implement your own serialiser to do this, which would replace the fields you want with something deterministic

Thanks for the tip on using a custom serializer. I was indeed able to accomplish what I wanted by writing my own serializer that overrides the attribute value for specific attribute names. I replaced this line
props[attribute.name] = attribute.value;

with
if (attribute.name === "id" || attribute.name === "for") {
  props[attribute.name] = "UNIQUE_ID";
} else {
  props[attribute.name] = attribute.value;
}

Thinking about how pretty-format could make this easier, perhaps a config option propOverrides of the form { [propName: string]: <value to print for name regardless of actual value> } that printProps would then use here. So for this example, propOverrides would be { id: "UNIQUE_ID", for: "UNIQUE_ID" }. printProps seems like the ideal place to handle this, since it is used by the DOMElement, ReactElement, and ReactTestComponent plugins.

any solution for this case?

Many components generate random unique id's, so this is a persistent problem with snapshots.  Which, properly developed, despite much disparaging, is a highly productive and robust testing methodology - high true positive to false positive ratio and easy test maintainability.  Especially in conjunction with react-testing-library. I'm currently forced to write a custom serializer.

At work we generate uuids using uuid, so for snapshots we mock it.

In general "replacing something in the snapshot" should be solved with a custom serializer as mentioned above. I don't think there's much to gain by changing pretty-format's API. If there is, please open up a new feature request 🙂

https://github.com/facebook/jest/pull/12501


Cannot override Devise passwords controller

I need my app to redirect to the home page after I submit the email to send me reset password instructions. Devise, by default renders the signin form after entering the email.
So I am trying to override the Devise::PasswordsController and change its redirect_to, but no success. Infact, I don't think rails is even taking in my class. I could be a very stupid mistake but I have been at it for half a day with no success.
I took the idea to override Passwords controller from here : https://github.com/plataformatec/devise/pull/1067
Here's my controller:
class PasswordsController < Devise::PasswordsController
protected
def after_sending_reset_password_instructions_path_for(resource_name)
root_url
end
end
Routes.rb:
devise_for :users, :controllers => {:passwords => "passwords"}
devise_for :users, :controllers => {:registrations => "registrations"}
devise_for :users, :controllers => {:sessions => "sessions"}
I would like to mention that I have overridden Devise's Registations and Sessions Controllers in the same app, and they seem to work fine.
Please help.

sorry, my bad. i will use the mailing list.


in submission view, pdfs containing large images run over footer

See screenshot below. Far from a big deal, it just looks a little awkward, and blocks the footer (including the "Github issues list" link - my favourite part of the interface!)
Seems to be limited to pdfs with large embedded images

Thanks for reporting this, fix should be in soon!


ffmpeg.wasm is not "technically" production ready!

I believe it makes sense to add an option to disable the WASM threads and use a single core (be it that it makes it slower). ffmpeg.js is massive and extremely slow and does not support most of the options we need, so it is not an option for us. At the same time, any attempt to use CORP and COEP disables Stripe, Intercom, and many other necessary integrations on our production website, which in effect makes ffmpeg.wasm not production-ready.
What happened to SharedArrayBuffer after the Spectre is fairly new and it's going to take some time for all the other companies out there to jump on the cross-origin isolation bandwagon.
Currently, there is only one way to use ffmpeg.wasm in production, which is by signing up for an origin trial to be able to use SharedArrayBuffers without cross-origin isolation, but this only works on Chrome, and only until Chrome 103, after which we are back to square one. There is some hope according to this article that options like Cross-Origin-Opener-Policy: same-origin-allow-popups might work in the future, but no one knows yet how many of those integrations would break again, back to my initial statement, without this option ffmpeg.wasm is not going to be actually production-ready.

Originally posted in https://github.com/ffmpegwasm/ffmpeg.wasm/issues/137#issuecomment-975383348

@hoomanaskari I agree, using CORP and COEP is an issue regarding the use of external resources.
However, I think an appropriate configuration of your back-end should let you use Stripe for example ?
I use ffmpeg-wasm in production (and I enable WASM threads) but I think I can use almost every service I want by configuring my back-end the right way.
Note: I use ffmpeg.wasm in the browser (frontend)

@julienbeisel I consulted with Stripe about the issue, unfortunately, this is something that has to be fixed by them, and they are not willing to solve it anytime soon. Same with Intercome. Because they both use iframes and CORP/COEP will block all unsafe iframes.

FFMPEG WASM is almost unusable at the current moment. Ah well, there goes my project down the drain.

@NayamAmarshe Unusable in what way? My website (GitHub repo: https://github.com/CrypticSignal/av-converter) is using FFmpeg WASM and it seems to be working okay, although it would be nice if the transcoding speed was as fast as running FFmpeg directly in the terminal.

I built the project manually to make it work with 1 core
https://github.com/ffmpegwasm/ffmpeg.wasm/issues/137
It's just a bit slow, but honestly if you just have short videos it works fine

@NayamAmarshe Unusable in what way? My website (GitHub repo: https://github.com/CrypticSignal/av-converter) is using FFmpeg WASM and it seems to be working okay, although it would be nice if the transcoding speed was as fast as running FFmpeg directly in the terminal.

https://github.com/ffmpegwasm/ffmpeg.wasm/issues/137

@Aeroxander What's the benefit of limiting it to only use one core?

@CrypticSignal Please refer to the original question for the reason behind it.

@hoomanaskari The OP said "I believe it makes sense to add an option to disable the WASM threads and use a single core (be it that it makes it slower)"
I don't understand why you'd want to make this slower? Or am I misreading that and what he is saying is that using threads instead of a single core makes it slower?

@CrypticSignal
"any attempt to use CORP and COEP disables Stripe, Intercom, and many other necessary integrations on our production website, which in effect makes ffmpeg.wasm not production-ready."
The point is not making it slower, the point is making it production-ready for an actual commercial and production-ready application.
Basically once you enable CORP and COEP which is required for wasm threads, you will have to set Cross-Origin-Opener-Policy: same-origin-allow-popups on all popups and iframe, if the iframes belong to you, you can do it yourself, but if in my case the iframe is the Stripe Checkout Form, then you are out of luck unless Stripe decides to enable it. I already contacted them and they refused to do anything about it at moment.
Giving an option to disbale threads, allows me to start using ffmpeg.wasm today and if at some point the CORP and COEP problems got resolved by Stripe etc. then I can enable it and make my app even faster.

@hoomanaskari I see, so CORP and COEP are only needed if threads are used but not if a single core is used. Interesting. I have no idea how WASM works, so I didn't know this.

The ffmpeg-asm.js doesn't have the security issues but is super slow.
If someone wants to try it out I threw up a demo here:
https://www.zaxtunes.com/client_transcoder/
Should be extremely easy to adapt to anyone elses use case.

@hoomanaskari Hi, thanks for the reply, I was wrong: we can't use Stripe on our website as well...
I'm thinking about workarounds. Do you think you can only cross-isolate a specific page (e.g. the page that runs ffmpeg wasm) so you can still use Stripe on other pages?
Otherwise I'll have to host our payment system on a different domain...


Please add root_validator

@root_validator
def _set_fields(cls, values: dict) -> dict:
DON'T WORK

I have PlacedSchema and in this PlacedSchema list of OrderSchema, on serialization OrderSchema validator don't work

Hi @50Bytes-dev, could you post an example of Django models and Djantic schemas that I can use to reproduce your issue to investigate?

Closing this until more info is provided.


UCP: Supports transparent transmission of parameters when running components

Description
Supports transparent transmission of parameters when running components.
e.g:
Currently, we want to pass some parameters to the component, we need to use -- to transparent transmission. tiup playground nightly -- --db 3 --pd 3 --kv 4. The ideal approach of running a playground with extras parameters is tiup playground nightly --db 3 --pd 3 --kv 4.
So, we need a mechical to transparent transmission paramaters to component in this sceniaro.
Score

300

Mentor(s)

@lonng

Contact the mentors: #tidb-challenge-program channel in TiDB Community  Slack Workspace
Recommended Skills

Golang

Closed via #60


How to add user Avatar ?

Can someone please help me out, how to add userAvatar ?
I understood from this (https://github.com/botfront/rasa-webchat/issues/321) about profileAvatar and openLauncherImage
Examples :
profileAvatar: "image-url",
openLauncherImage: "image-url"

Do you mean an image that would represent user that is talking to the chatbot?

any update on this? Or is it possible to modify the code ourselves?


Fix/various

This changes fixe some issues

#169: do not delete service instance if this one is in forced enrollment
#172 due to evolution in client library, a host is expected, not a full target endpoint
#174 fixe an old forgotten inactivityparameter

Coverage increased (+0.02%) to 96.26% when pulling 41d9d2fe72cdaa71340b7fc417339bb8416c2085 on fix/various into aa844e2c637c0750f9ef88686015d2fa166da1ac on develop.

Coverage increased (+0.02%) to 96.26% when pulling 41d9d2fe72cdaa71340b7fc417339bb8416c2085 on fix/various into aa844e2c637c0750f9ef88686015d2fa166da1ac on develop.


fix(CAMERA_STREAM): pause stream when screensaver active or page changed

Implemented in a way where the playback is stopped when "freezed" (should be "frozen") is true and after 5s, if "freezed" doesn't become false, the stream is stopped completely.
The stream playing in a popup is only stopped on screensaver activation (as pages can't be changed in that case), while the stream tiles are stopped on screensaver and page change.
Resolves #541

Great! Lets indeed rename freezed to frozen perhaps?

Perfect! Thank you very much!


How to check if key existed

Hi to all is there a method to check if the key exist ,
what is the close to
Java JSON

indivFB.has("object_id")

Thanks

Just like for a map: find().

Hi thanks for the reply but im using iterator
any idea why is causing this problem ?

Value of type 'iterator' (aka 'nlohmann::detail::iter_impl<nlohmann::basic_json<std::map, std::vector, std::__1::basic_string, bool, long long, unsigned long long, double, std::allocator, adl_serializer> >') is not contextually convertible to 'bool'

I would need to see a code example for that.

Hi thanks for time,
The problem i face is that sometimes the json result doesnt have the key so im trying to check for the key

When you iterate over an object (which I assume - I have not seen the JSON), doing this with a range for only gives you access to the values, not to the keys. You need to use items() for this.
The exception comes, because you try to assign a number (from ...["total_count"]) to a string (totallike). Try to output ...["total_count"] directly and use a number type for totallike.

Sorry wrong image it should be this

Then use find:
if (json_field_data[p]["reactions"]["summary"].find("total_count") != json_field_data[p]["reactions"]["summary"].end())
   // now you can be sure json_field_data[p]["reactions"]["summary"]["total_count"] exists

Alternatively, you could use value and provide a default value (e.g., 0):
totallike = json_field_data[p]["reactions"]["summary"].value("total_count", 0);

Thanks for the library and the help

In case if we are not sure if the keys before the nested key exist, should we use nested if ? Because in the documentation it's wrote that is an undefined behavior to if the element with key idx accessing by operator[] does not exist.
if (json_field_data[p].find("reactions") != json_field_data[p].end()){
    if(json_field_data[p]["reactions"].find("summary") != json_field_data[p]["reactions"].end()){
        if(json_field_data[p]["reactions"]["summary"].find("total_count") != json_field_data[p]["reactions"]["summary"].end())
    }
}

In case if we are not sure if the keys before the nested key exist, should we use nested if ? Because in the documentation it's wrote that is an undefined behavior to if the element with key idx accessing by operator[] does not exist.
if (json_field_data[p].find("reactions") != json_field_data[p].end()){
    if(json_field_data[p]["reactions"].find("summary") != json_field_data[p]["reactions"].end()){
        if(json_field_data[p]["reactions"]["summary"].find("total_count") != json_field_data[p]["reactions"]["summary"].end())
    }
}

Yes, you need to check for each level. Note there is a contains function that could simplify your code: https://json.nlohmann.me/api/basic_json/contains/
Also note that that JSON Pointer could help you, see https://github.com/nlohmann/json/discussions/2585#discussioncomment-280524

Yes, you need to check for each level. Note there is a contains function that could simplify your code: https://json.nlohmann.me/api/basic_json/contains/
Also note that that JSON Pointer could help you, see https://github.com/nlohmann/json/discussions/2585#discussioncomment-280524