问:
getting error in Registration screen in flutter
account is not registering and it is already in use the snackbar is working when i am connected with usb and run the code but when i am generating apk file the snackbar and signin is not working i added all the details in my gradle file like storefile progaurd file everything with signingConfig signingConfigs.release key too

```<code><uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</code>```

i added this permission

```<code>  class SignUpPage extends StatefulWidget {
      const SignUpPage({Key? key}) : super(key: key);

      @override
      _SignUpPageState createState() => _SignUpPageState();
    }

    class _SignUpPageState extends State<SignUpPage> {
      final _formKey = GlobalKey<FormState>();
      var email = "";
      var password = "";
      var confirmpassword = "";

      final emailController = TextEditingController();
      final passwordController = TextEditingController();
      final confirmPasswordController = TextEditingController();
        final storage = new FlutterSecureStorage();
        String? validateEmail(String value) {
        Pattern pattern =
            r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
        RegExp regex = RegExp(pattern as String);
        if (!regex.hasMatch(value)) {
          return 'Enter Valid Email';
        } else {
          return null;
        }
      }

      @override
      void dispose() {
        emailController.dispose();
        passwordController.dispose();
        confirmPasswordController.dispose();
        super.dispose();
      }

      registration() async {
        if (password == confirmpassword) {
          try {
            UserCredential userCredential = await FirebaseAuth.instance
                .createUserWithEmailAndPassword(email: email, password: password);
            if (kDebugMode) {
              print(userCredential);
            }
            ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
              backgroundColor: Colors.redAccent,
              content: Text(
                "Registered Successfully. Logged In..",
                style: TextStyle(fontSize: 20.0, color: Colors.white),
              ),
            ));
            Navigator.pushReplacement(
                context, MaterialPageRoute(builder: (context) => StartQuiz()));
          } on FirebaseAuthException catch (e) {
            if (e.code == 'email-already-in-use') {
              if (kDebugMode) {
                print(" Account Already in use");
                ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
                  backgroundColor: Colors.black,
                  content: Text(
                    "Account Already in use",
                    style: TextStyle(fontSize: 18.0, color: Colors.white),
                  ),
                ));
              }
            }
          }
        } else {
          if (kDebugMode) {
            print("Password and Confirm Password doesn't match");
            ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
              backgroundColor: Colors.black,
              content: Text(
                "Password and Confirm Password doesn't match",
                style: TextStyle(fontSize: 16.0),
              ),
            ));
          }
        }
      }

      @override
      Widget build(BuildContext context) {
        return SafeArea(
          child: Scaffold(
            backgroundColor: Colors.white,
            body: SingleChildScrollView(
              child: Container(
                width: 500,
                height: 800,
                decoration: const BoxDecoration(
                            image: DecorationImage(
                              image: AssetImage(
                                "images/data7.png",
                              ),
                              fit: BoxFit.cover,
                            ),
                          ),
                child: Column(
                  children: [
                    Align(
                      alignment: Alignment.center,
                      child: Container(
                          width: 500,
                          height: 300,
                          decoration: const BoxDecoration(
                            image: DecorationImage(
                              image: AssetImage(
                                "images/d9.png",
                              ),
                              fit: BoxFit.cover,
                            ),
                          )),
                    ),
                    Form(
                        key: _formKey,
                        child: Padding(
                          padding: const EdgeInsets.symmetric(
                              vertical: 20, horizontal: 30),
                          child: Column(
                            children: [
                              Container(
                                decoration: BoxDecoration(
                                    color: Colors.white,
                                    borderRadius: BorderRadius.circular(30),
                                    boxShadow: [
                                      BoxShadow(
                                          spreadRadius: 7,
                                          blurRadius: 10,
                                          offset: const Offset(1, 1),
                                          color: Colors.grey.withOpacity(0.2))
                                    ]),
                                child: TextField(
                                  autofocus: false,
                                  decoration: InputDecoration(
                                      hintText: "Email",
                                      prefixIcon: const Icon(
                                        Icons.email,
                                        color: Color.fromARGB(255, 150, 188, 255),
                                      ),
                                      focusedBorder: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30),
                                          borderSide: const BorderSide(
                                              color: Colors.white, width: 1.0)),
                                      enabledBorder: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30),
                                          borderSide: const BorderSide(
                                              color: Colors.white, width: 1.0)),
                                      border: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30))),
                                  controller: emailController,
                                ),
                              ),
                              const SizedBox(
                                height: 20,
                              ),
                              Container(
                                decoration: BoxDecoration(
                                    color: Colors.white,
                                    borderRadius: BorderRadius.circular(30),
                                    boxShadow: [
                                      BoxShadow(
                                          spreadRadius: 7,
                                          blurRadius: 10,
                                          offset: const Offset(1, 1),
                                          color: Colors.grey.withOpacity(0.2))
                                    ]),
                                child: TextField(
                                  autofocus: false,
                                  obscureText: true,
                                  decoration: InputDecoration(
                                    hintText: "Password",
                                    prefixIcon: const Icon(
                                      Icons.lock,
                                      color: Color.fromARGB(255, 150, 188, 255),
                                    ),
                                    focusedBorder: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(30),
                                        borderSide: const BorderSide(
                                            color: Colors.white, width: 1.0)),
                                    enabledBorder: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(30),
                                        borderSide: const BorderSide(
                                            color: Colors.white, width: 1.0)),
                                    border: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(30)),
                                    errorStyle: const TextStyle(
                                        color: Colors.redAccent, fontSize: 15),
                                  ),
                                  controller: passwordController,
                                ),
                              ),
                              const SizedBox(
                                height: 20,
                              ),
                              Container(
                                decoration: BoxDecoration(
                                    color: Colors.white,
                                    borderRadius: BorderRadius.circular(30),
                                    boxShadow: [
                                      BoxShadow(
                                          spreadRadius: 7,
                                          blurRadius: 10,
                                          offset: const Offset(1, 1),
                                          color: Colors.grey.withOpacity(0.2))
                                    ]),
                                child: TextField(
                                  autofocus: false,
                                  obscureText: true,
                                  decoration: InputDecoration(
                                      hintText: "Confirm Password",
                                      prefixIcon: const Icon(
                                        Icons.lock,
                                        color: Color.fromARGB(255, 150, 188, 255),
                                      ),
                                      focusedBorder: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30),
                                          borderSide: const BorderSide(
                                              color: Colors.white, width: 1.0)),
                                      enabledBorder: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30),
                                          borderSide: const BorderSide(
                                              color: Colors.white, width: 1.0)),
                                      border: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30))),
                                  controller: confirmPasswordController,
                                ),
                              ),
                              const SizedBox(
                                height: 20,
                              ),
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  children: [
                                    GestureDetector(
                                      onTap: () {
                                        // Validate returns true if the form is valid, otherwise false.
                                        if (_formKey.currentState!.validate()) {
                                          setState(() {
                                            email = emailController.text;
                                            password = passwordController.text;
                                            confirmpassword =
                                                confirmPasswordController.text;
                                          });
                                          registration();
                                        }
                                      },
                                      child: Container(
                                        decoration: BoxDecoration(
                                            borderRadius: BorderRadius.circular(30),
                                            gradient: const LinearGradient(
                                              colors: [
                                                Color(0xFFACB6E5),
                                                Color(0xFF86FDE8)
                                              ],
                                            )),
                                        width: 190,
                                        height: 60,
                                        child: const Center(
                                          child: Text(
                                            'Sign Up',
                                            style: TextStyle(
    fontWeight: FontWeight.bold ,fontSize: 21.0, color: Colors.indigo),                                    ),
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              const SizedBox(
                                height: 10,
                              ),
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  children: [
                                    Text(
                                      "Already have an Account? ",
                                      style: TextStyle(color: Colors.indigo.shade300),
                                    ),
                                    TextButton(
                                        onPressed: () => {
                                              Navigator.pushReplacement(
                                                context,
                                                PageRouteBuilder(
                                                  pageBuilder: (context, animation1,
                                                          animation2) =>
                                                      const LoginPage(),
                                                  transitionDuration:
                                                      const Duration(seconds: 0),
                                                ),
                                              )
                                            },
                                        child: const Text(
                                          'Login here',
                                          style: TextStyle(
                                              color: Colors.black54,
                                              fontFamily: 'Montserrat',
                                              fontSize: 15,
                                              fontWeight: FontWeight.bold,
                                              decoration: TextDecoration.underline),
                                        ))
                                  ],
                                ),
                              )
                            ],
                          ),
                        )),
}
</code>```

Body:
account is not registering and it is already in use the snackbar is working when i am connected with usb and run the code but when i am generating apk file the snackbar and signin is not working i added all the details in my gradle file like storefile progaurd file everything with signingConfig signingConfigs.release key too

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

i added this permission

  class SignUpPage extends StatefulWidget {
      const SignUpPage({Key? key}) : super(key: key);

      @override
      _SignUpPageState createState() => _SignUpPageState();
    }

    class _SignUpPageState extends State<SignUpPage> {
      final _formKey = GlobalKey<FormState>();
      var email = "";
      var password = "";
      var confirmpassword = "";

      final emailController = TextEditingController();
      final passwordController = TextEditingController();
      final confirmPasswordController = TextEditingController();
        final storage = new FlutterSecureStorage();
        String? validateEmail(String value) {
        Pattern pattern =
            r'^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$';
        RegExp regex = RegExp(pattern as String);
        if (!regex.hasMatch(value)) {
          return 'Enter Valid Email';
        } else {
          return null;
        }
      }

      @override
      void dispose() {
        emailController.dispose();
        passwordController.dispose();
        confirmPasswordController.dispose();
        super.dispose();
      }

      registration() async {
        if (password == confirmpassword) {
          try {
            UserCredential userCredential = await FirebaseAuth.instance
                .createUserWithEmailAndPassword(email: email, password: password);
            if (kDebugMode) {
              print(userCredential);
            }
            ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
              backgroundColor: Colors.redAccent,
              content: Text(
                "Registered Successfully. Logged In..",
                style: TextStyle(fontSize: 20.0, color: Colors.white),
              ),
            ));
            Navigator.pushReplacement(
                context, MaterialPageRoute(builder: (context) => StartQuiz()));
          } on FirebaseAuthException catch (e) {
            if (e.code == 'email-already-in-use') {
              if (kDebugMode) {
                print(" Account Already in use");
                ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
                  backgroundColor: Colors.black,
                  content: Text(
                    "Account Already in use",
                    style: TextStyle(fontSize: 18.0, color: Colors.white),
                  ),
                ));
              }
            }
          }
        } else {
          if (kDebugMode) {
            print("Password and Confirm Password doesn't match");
            ScaffoldMessenger.of(context).showSnackBar(const SnackBar(
              backgroundColor: Colors.black,
              content: Text(
                "Password and Confirm Password doesn't match",
                style: TextStyle(fontSize: 16.0),
              ),
            ));
          }
        }
      }

      @override
      Widget build(BuildContext context) {
        return SafeArea(
          child: Scaffold(
            backgroundColor: Colors.white,
            body: SingleChildScrollView(
              child: Container(
                width: 500,
                height: 800,
                decoration: const BoxDecoration(
                            image: DecorationImage(
                              image: AssetImage(
                                "images/data7.png",
                              ),
                              fit: BoxFit.cover,
                            ),
                          ),
                child: Column(
                  children: [
                    Align(
                      alignment: Alignment.center,
                      child: Container(
                          width: 500,
                          height: 300,
                          decoration: const BoxDecoration(
                            image: DecorationImage(
                              image: AssetImage(
                                "images/d9.png",
                              ),
                              fit: BoxFit.cover,
                            ),
                          )),
                    ),
                    Form(
                        key: _formKey,
                        child: Padding(
                          padding: const EdgeInsets.symmetric(
                              vertical: 20, horizontal: 30),
                          child: Column(
                            children: [
                              Container(
                                decoration: BoxDecoration(
                                    color: Colors.white,
                                    borderRadius: BorderRadius.circular(30),
                                    boxShadow: [
                                      BoxShadow(
                                          spreadRadius: 7,
                                          blurRadius: 10,
                                          offset: const Offset(1, 1),
                                          color: Colors.grey.withOpacity(0.2))
                                    ]),
                                child: TextField(
                                  autofocus: false,
                                  decoration: InputDecoration(
                                      hintText: "Email",
                                      prefixIcon: const Icon(
                                        Icons.email,
                                        color: Color.fromARGB(255, 150, 188, 255),
                                      ),
                                      focusedBorder: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30),
                                          borderSide: const BorderSide(
                                              color: Colors.white, width: 1.0)),
                                      enabledBorder: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30),
                                          borderSide: const BorderSide(
                                              color: Colors.white, width: 1.0)),
                                      border: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30))),
                                  controller: emailController,
                                ),
                              ),
                              const SizedBox(
                                height: 20,
                              ),
                              Container(
                                decoration: BoxDecoration(
                                    color: Colors.white,
                                    borderRadius: BorderRadius.circular(30),
                                    boxShadow: [
                                      BoxShadow(
                                          spreadRadius: 7,
                                          blurRadius: 10,
                                          offset: const Offset(1, 1),
                                          color: Colors.grey.withOpacity(0.2))
                                    ]),
                                child: TextField(
                                  autofocus: false,
                                  obscureText: true,
                                  decoration: InputDecoration(
                                    hintText: "Password",
                                    prefixIcon: const Icon(
                                      Icons.lock,
                                      color: Color.fromARGB(255, 150, 188, 255),
                                    ),
                                    focusedBorder: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(30),
                                        borderSide: const BorderSide(
                                            color: Colors.white, width: 1.0)),
                                    enabledBorder: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(30),
                                        borderSide: const BorderSide(
                                            color: Colors.white, width: 1.0)),
                                    border: OutlineInputBorder(
                                        borderRadius: BorderRadius.circular(30)),
                                    errorStyle: const TextStyle(
                                        color: Colors.redAccent, fontSize: 15),
                                  ),
                                  controller: passwordController,
                                ),
                              ),
                              const SizedBox(
                                height: 20,
                              ),
                              Container(
                                decoration: BoxDecoration(
                                    color: Colors.white,
                                    borderRadius: BorderRadius.circular(30),
                                    boxShadow: [
                                      BoxShadow(
                                          spreadRadius: 7,
                                          blurRadius: 10,
                                          offset: const Offset(1, 1),
                                          color: Colors.grey.withOpacity(0.2))
                                    ]),
                                child: TextField(
                                  autofocus: false,
                                  obscureText: true,
                                  decoration: InputDecoration(
                                      hintText: "Confirm Password",
                                      prefixIcon: const Icon(
                                        Icons.lock,
                                        color: Color.fromARGB(255, 150, 188, 255),
                                      ),
                                      focusedBorder: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30),
                                          borderSide: const BorderSide(
                                              color: Colors.white, width: 1.0)),
                                      enabledBorder: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30),
                                          borderSide: const BorderSide(
                                              color: Colors.white, width: 1.0)),
                                      border: OutlineInputBorder(
                                          borderRadius: BorderRadius.circular(30))),
                                  controller: confirmPasswordController,
                                ),
                              ),
                              const SizedBox(
                                height: 20,
                              ),
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  children: [
                                    GestureDetector(
                                      onTap: () {
                                        // Validate returns true if the form is valid, otherwise false.
                                        if (_formKey.currentState!.validate()) {
                                          setState(() {
                                            email = emailController.text;
                                            password = passwordController.text;
                                            confirmpassword =
                                                confirmPasswordController.text;
                                          });
                                          registration();
                                        }
                                      },
                                      child: Container(
                                        decoration: BoxDecoration(
                                            borderRadius: BorderRadius.circular(30),
                                            gradient: const LinearGradient(
                                              colors: [
                                                Color(0xFFACB6E5),
                                                Color(0xFF86FDE8)
                                              ],
                                            )),
                                        width: 190,
                                        height: 60,
                                        child: const Center(
                                          child: Text(
                                            'Sign Up',
                                            style: TextStyle(
    fontWeight: FontWeight.bold ,fontSize: 21.0, color: Colors.indigo),                                    ),
                                        ),
                                      ),
                                    ),
                                  ],
                                ),
                              ),
                              const SizedBox(
                                height: 10,
                              ),
                              Container(
                                child: Row(
                                  mainAxisAlignment: MainAxisAlignment.center,
                                  children: [
                                    Text(
                                      "Already have an Account? ",
                                      style: TextStyle(color: Colors.indigo.shade300),
                                    ),
                                    TextButton(
                                        onPressed: () => {
                                              Navigator.pushReplacement(
                                                context,
                                                PageRouteBuilder(
                                                  pageBuilder: (context, animation1,
                                                          animation2) =>
                                                      const LoginPage(),
                                                  transitionDuration:
                                                      const Duration(seconds: 0),
                                                ),
                                              )
                                            },
                                        child: const Text(
                                          'Login here',
                                          style: TextStyle(
                                              color: Colors.black54,
                                              fontFamily: 'Montserrat',
                                              fontSize: 15,
                                              fontWeight: FontWeight.bold,
                                              decoration: TextDecoration.underline),
                                        ))
                                  ],
                                ),
                              )
                            ],
                          ),
                        )),
}


来源: stackexchange

问:
How can I hide indent guide in VsCode Terminal?
I want to hide these indent lines in Terminal but I don't want to hide them in Editor section.

Thank you for suggestion.

ContentLicense: CC BY-SA 4.0


问:
Factory pattern causing circular dependency in typescript
I was using a factory design pattern in my typescript codebase and came across a circular dependency problem. Below is some pseudo-code that represents the problem I'm facing:

// shape-factory.ts
export function createShapeByType(type: string) {
  if (type === 'circle') {
    return new Circle();
  }
  if (type === 'triangle') {
    return new Triangle();
  }
}

// shape.ts
class Shape {
  public type = 'shape';
}

// circle.ts
class Circle extends Shape {
  public type = 'circle';

  public foo() {
    const type = 'whatever'; // imagine here's some code that returns a type string based on some conditions
    const shape = createShapeByType(type); // circular dependency
  }
}

// triangle.ts
class Triangle extends Shape {
  public type = 'triangle';
}
```

As you can see the foo method in Circle class depends on the factory method, and the factory file depends on Circle, which creates a circular dependency.

I was googling around and most of the answers suggest to refactor out an interface layer, and both the concrete object and the factory only depend on the interface to talk to each other. To my understanding, that solution requires me to pass in the factory implementation through constructor injection or some sort, so that the concrete itself does not depend on the actual implementation of the factory.

My question would be, is there an easier way to solve the problem, other than the solution that I mentioned above? Thank you.

Body:
I was using a factory design pattern in my typescript codebase and came across a circular dependency problem. Below is some pseudo-code that represents the problem I'm facing:

// shape-factory.ts
export function createShapeByType(type: string) {
  if (type === 'circle') {
    return new Circle();
  }
  if (type === 'triangle') {
    return new Triangle();
  }
}

// shape.ts
class Shape {
  public type = 'shape';
}

// circle.ts
class Circle extends Shape {
  public type = 'circle';

  public foo() {
    const type = 'whatever'; // imagine here's some code that returns a type string based on some conditions
    const shape = createShapeByType(type); // circular dependency
  }
}

// triangle.ts
class Triangle extends Shape {
  public type = 'triangle';
}

As you can see the foo method in Circle class depends on the factory method, and the factory file depends on Circle, which creates a circular dependency.

I was googling around and most of the answers suggest to refactor out an interface layer, and both the concrete object and the factory only depend on the interface to talk to each other. To my understanding, that solution requires me to pass in the factory implementation through constructor injection or some sort, so that the concrete itself does not depend on the actual implementation of the factory.

My question would be, is there an easier way to solve the problem, other than the solution that I mentioned above? Thank you.


问:
Multiple blazor component on dashboard use same repositorymethod but with different values, only one call to method works
On my dashboard in a Blazor server project I got some blazor components. If I only use the component one time on my dashboard, it works, but not if I use it twice (or make a copy and have UserId as a constant) it will not work.

From the component I call

```<code>protected override async Task OnParametersSetAsync()
{
    listTodo = await TodoRepository.GetUserTodos(UserId, 5);
}
</code>```

Where UserId change between my component call.

My repository :

```<code>   public async Task<IEnumerable<TodoWithRelatedDTO>> GetUserTodos(int userId, int ant = 0)
    {
        try
        {
            DateTime today = DateTime.Now;

            IQueryable<Todo> todos = _db.Todos
                .Where(w => w.OwnerId == userId && w.WorkId == null && w.DatumPlan != null)
                .OrderBy(o => o.DatumPlan)
                .Include(a => a.OwnerPerson);

            if (ant > 0)
            {
                todos = todos.Take(ant);
            }
            IList<Todo> todons = await todos.AsNoTracking().ToListAsync();  // <<<< THIS ROW >>>>

            IList<TodoWithRelatedDTO> twrDTO = new List<TodoWithRelatedDTO>();

            _mapper.Map(todons, twrDTO);

            foreach (TodoWithRelatedDTO item in twrDTO)
            {
                switch (item.AModul)
                {
        // Some code
                }

            }
            return twrDTO;
        }
        catch
        {
            return null;
        }

    }
</code>```

I have done some errorsearch and found out that where I marked <<<< THIS ROW >>>> there happens something.
When this row is done in first component, then next component will call GetUserTodos.  And when all component are done to row marked with <<<< THIS ROW >>>> the rest of GetUserTodos from first components call will go on and then I got an error and came to catch { return null } and only the last components call to GetUserTodos will finish correctly..

Anyone that have a clue how to solve this error?  Are DB factory the way to go, I think there could be a problem with my AddDbContext? Now I have

```<code>builder.Services.AddDbContext<ApplicationDbContext>(options =>
{
    options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"));
}, ServiceLifetime.Transient);
</code>```

Problem solved :
I dive into DB factory and that solve the problem.

Body:
On my dashboard in a Blazor server project I got some blazor components. If I only use the component one time on my dashboard, it works, but not if I use it twice (or make a copy and have UserId as a constant) it will not work.

From the component I call

protected override async Task OnParametersSetAsync()
{
    listTodo = await TodoRepository.GetUserTodos(UserId, 5);
}

Where UserId change between my component call.

My repository :

   public async Task<IEnumerable<TodoWithRelatedDTO>> GetUserTodos(int userId, int ant = 0)
    {
        try
        {
            DateTime today = DateTime.Now;

            IQueryable<Todo> todos = _db.Todos
                .Where(w => w.OwnerId == userId && w.WorkId == null && w.DatumPlan != null)
                .OrderBy(o => o.DatumPlan)
                .Include(a => a.OwnerPerson);

            if (ant > 0)
            {
                todos = todos.Take(ant);
            }
            IList<Todo> todons = await todos.AsNoTracking().ToListAsync();  // <<<< THIS ROW >>>>

            IList<TodoWithRelatedDTO> twrDTO = new List<TodoWithRelatedDTO>();

            _mapper.Map(todons, twrDTO);

            foreach (TodoWithRelatedDTO item in twrDTO)
            {
                switch (item.AModul)
                {
        // Some code
                }

            }
            return twrDTO;
        }
        catch
        {
            return null;
        }

    }

I have done some errorsearch and found out that where I marked <<<< THIS ROW >>>> there happens something.
When this row is done in first component, then next component will call GetUserTodos.  And when all component are done to row marked with <<<< THIS ROW >>>> the rest of GetUserTodos from first components call will go on and then I got an error and came to catch { return null } and only the last components call to GetUserTodos will finish correctly..

Anyone that have a clue how to solve this error?  Are DB factory the way to go, I think there could be a problem with my AddDbContext? Now I have

builder.Services.AddDbContext<ApplicationDbContext>(options =>
{
    options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"));
}, ServiceLifetime.Transient);

Problem solved :
I dive into DB factory and that solve the problem.


问:
Upload file and convert on the fly- django
I have this file in txt that am cleaning and converting it to excel which have been able to, i just wanted to make an in interface for the user to do the conversion instead of using the raw code..

I have tried to upload the file but now unable to connect the 'dots'


问:
whenever select the multiple files through input type file then print the filename and number of pages present in file using React-pdf
I just want to display multiple filenames and the number of pages present in a particular file. for the number of pages, I'm using the react-pdf library

I'm only able to display file names but didn't able to demonstrate/show pdf files when I selected (input file method)

my screen

code is here: -

codesandbox code link


问:
Need to Find end of sub id after input parent id
Database Image

I need to find Enter menus database id is 2 after showing end of sub id in database.

Expample 2>5>8 , 2>5>14 , 2>9>10>11

2 is enter value
8,14,11 need valus


问:
I am using intersection observer but is not working as intended
so the elements are showing but when I am searching for something and clearing the search field, only the search items remain rest goes away, and I mainly want to add the items when the view has come to that. how can I do that please help

function Details() {
const { covidData, loading, searchQuery, theme, serverMessage } = useGlobalContext()
const elementRefs = useRef()
const [isVisible, setIsVisible] = useState(false)

```<code>const assignRef = id =\> node =\> {
    elementRefs.current = {
        ...elementRefs.current,
        \[id\]: node
    }
}

useEffect(() =\> {
    const observer = new IntersectionObserver(entries =\> {
        for(const entry of entries) {
            if(entry.isIntersecting) {
                entry.target.classList.remove("card")
                entry.target.classList.add("show", entry.isIntersecting)
                setIsVisible(true)
            }
            if(searchQuery) {
                entry.isIntersecting && observer.unobserve(entry.target)
            }
        }
    })
    for(let key in elementRefs.current) {
        observer.observe(elementRefs.current\[key\])
    }
}, \[elementRefs, loading\])
return (
    \<\>
        {
            loading || serverMessage
                ? \<h2 className={\`text-2xl text-center ${theme === "light" ? "text-gray-800" : "text-white"} mt-5 font-semibold\`}\>
                    {serverMessage ? serverMessage : "Loading Data Please Wait...."}
                \</h2\>
                :
                \<section className="grid grid-cols-1 gap-10 px-10 py-10 sm:grid-cols-2 lg:grid-cols-3 2xl:grid-cols-4 2xl:px-20"\>
                    {covidData?.filter((item) =\> {
                        return searchQuery.toLowerCase() === ""
                            ? item
                            : item.Country.toLowerCase().includes(searchQuery)

                    }).map((data) =\> {
                        const {
                            ID,
                            Country,
                            CountryCode,
                            NewConfirmed,
                            TotalConfirmed,
                            NewDeaths,
                            TotalDeaths,
                            NewRecovered,
                            TotalRecovered,
                            Date,
                        } = data

                        return (
                            \<div key={ID} ref={assignRef(ID)} className="card bg-gray-800 p-4 rounded"\>

                            {isVisible &&
                            \<\>
                                \<h2 className="font-bold text-green-400 text-3xl mb-4"\>
                                    {Country}, \<span className="font-light"\>{CountryCode}\</span\>
                                \</h2\>
                                \<ul\>
                                    \<li className="flex justify-between my-2 text-red-300"\>
                                        \<span className="font-bold"\>New Confirmed Cases:\</span\>{' '}
                                        {NewConfirmed}
                                    \</li\>
                                    \<li className="flex justify-between my-2 text-blue-300"\>
                                        \<span className="font-bold"\>Total Confirmed Cases:\</span\>{' '}
                                        {TotalConfirmed}
                                    \</li\>
                                    \<li className="flex justify-between my-2 text-yellow-300"\>
                                        \<span className="font-bold"\>New Deaths:\</span\> {NewDeaths}
                                    \</li\>
                                    \<li className="flex justify-between my-2 text-purple-300"\>
                                        \<span className="font-bold"\>Total Deaths:\</span\> {TotalDeaths}
                                    \</li\>
                                    \<li className="flex justify-between my-2 text-indigo-300"\>
                                        \<span className="font-bold"\>New Recovered Cases:\</span\>{' '}
                                        {NewRecovered}
                                    \</li\>
                                    \<li className="flex justify-between my-2 text-pink-300"\>
                                        \<span className="font-bold"\>Total Recovered Cases:\</span\>{' '}
                                        {TotalRecovered}
                                    \</li\>
                                    \<li className="text-green-100 mt-5"\>
                                        \<span className="font-bold"\>Date:\</span\>{' '}
                                        {moment(\`${Date}\`).format('MMMM Do YYYY hh:mm:ss')}
                                    \</li\>
                                \</ul\>
                                \</\>}
                            \</div\>
                        )
                    })}
                \</section\>
        }
    \</\>
)
</code>```

}

export default Details

i mainly want to add the items when the view has come to that

Body:
so the elements are showing but when I am searching for something and clearing the search field, only the search items remain rest goes away, and I mainly want to add the items when the view has come to that. how can I do that please help

function Details() {
const { covidData, loading, searchQuery, theme, serverMessage } = useGlobalContext()
const elementRefs = useRef()
const [isVisible, setIsVisible] = useState(false)

const assignRef = id =\> node =\> {
    elementRefs.current = {
        ...elementRefs.current,
        \[id\]: node
    }
}

useEffect(() =\> {
    const observer = new IntersectionObserver(entries =\> {
        for(const entry of entries) {
            if(entry.isIntersecting) {
                entry.target.classList.remove("card")
                entry.target.classList.add("show", entry.isIntersecting)
                setIsVisible(true)
            }
            if(searchQuery) {
                entry.isIntersecting && observer.unobserve(entry.target)
            }
        }
    })
    for(let key in elementRefs.current) {
        observer.observe(elementRefs.current\[key\])
    }
}, \[elementRefs, loading\])
return (
    \<\>
        {
            loading || serverMessage
                ? \<h2 className={\`text-2xl text-center ${theme === "light" ? "text-gray-800" : "text-white"} mt-5 font-semibold\`}\>
                    {serverMessage ? serverMessage : "Loading Data Please Wait...."}
                \

                :
                \

                    {covidData?.filter((item) =\> {
                        return searchQuery.toLowerCase() === ""
                            ? item
                            : item.Country.toLowerCase().includes(searchQuery)

                    }).map((data) =\> {
                        const {
                            ID,
                            Country,
                            CountryCode,
                            NewConfirmed,
                            TotalConfirmed,
                            NewDeaths,
                            TotalDeaths,
                            NewRecovered,
                            TotalRecovered,
                            Date,
                        } = data

                        return (
                            \

                            {isVisible &&
                            \<\>
                                \

                                    {Country}, \{CountryCode}\
                                \

                                \

                                    \

                                        \New Confirmed Cases:\{' '}
                                        {NewConfirmed}
                                    \

                                    \

                                        \Total Confirmed Cases:\{' '}
                                        {TotalConfirmed}
                                    \

                                    \

                                        \New Deaths:\ {NewDeaths}
                                    \

                                    \

                                        \Total Deaths:\ {TotalDeaths}
                                    \

                                    \

                                        \New Recovered Cases:\{' '}
                                        {NewRecovered}
                                    \

                                    \

                                        \Total Recovered Cases:\{' '}
                                        {TotalRecovered}
                                    \

                                    \

                                        \Date:\{' '}
                                        {moment(\`${Date}\`).format('MMMM Do YYYY hh:mm:ss')}
                                    \

                                \

                                \</\>}
                            \

                        )
                    })}
                \

        }
    \</\>
)

}

export default Details

i mainly want to add the items when the view has come to that


问:
How am I supposed to use Apache XML-RPC's TypeConvertorFactory on the server side?
I am struggling to get Apache XML-RPC to call my TypeConvertorFactory at all.  It is calling it on the client side (only return values confirmed to work so far, haven't tested parameters) but the server side isn't calling it at all.

My initialisation code looks like this:

```<code>XmlRpcServlet servlet = new XmlRpcServlet();
XmlRpcServerConfigImpl config = new XmlRpcServerConfigImpl();
config.setEnabledForExtensions(true);
servlet.getXmlRpcServletServer().setConfig(config);
servlet.getXmlRpcServletServer().setTypeConverterFactory(
    new ServerTypeConvertorFactory());
</code>```

The API looks like this:

```<code>private interface API {
    AvailableLicencesResponse availableLicences();
}
</code>```

AvailableLicencesResponse is just an ordinary boring, albeit deeply nested JavaBean.

At the moment, the server sends this response as Base64 (this works because I called setEnabledForExtensions(true) - but if I don't call that, I get "unexpected end of stream" type errors instead, with no additional error anywhere to tell me why.)

I have set breakpoints inside ServerTypeConvertorFactory and it seems that none of the methods are being called on the server.  The same breakpoints show the client calling convert() when the server hands back the result, but the result is already the correct type due to serialisation magic so I don't need to convert it.

Essentially, what I am trying to do is to implement a wire protocol which conforms to standard XML-RPC (and doesn't use huge amounts of Base64 data...) while still having an API which doesn't require a thousand casts and calls to Map.get().  I also want to avoid having to make more calls than necessary, which is why I'm returning a bean instead of having separate methods to get each property of it, which would have worked too.

(Also, if there is a simpler to use API than this one, I'm open for suggestions.  It started out being really easy, but that's until you need to customise it.  Also, anyone suggesting Axis or other SOAP-based APIs will be shot at dawn.)

ContentLicense: CC BY-SA 3.0

Body:
I am struggling to get Apache XML-RPC to call my TypeConvertorFactory at all.  It is calling it on the client side (only return values confirmed to work so far, haven't tested parameters) but the server side isn't calling it at all.

My initialisation code looks like this:

XmlRpcServlet servlet = new XmlRpcServlet();
XmlRpcServerConfigImpl config = new XmlRpcServerConfigImpl();
config.setEnabledForExtensions(true);
servlet.getXmlRpcServletServer().setConfig(config);
servlet.getXmlRpcServletServer().setTypeConverterFactory(
    new ServerTypeConvertorFactory());

The API looks like this:

private interface API {
    AvailableLicencesResponse availableLicences();
}

AvailableLicencesResponse is just an ordinary boring, albeit deeply nested JavaBean.

At the moment, the server sends this response as Base64 (this works because I called setEnabledForExtensions(true) - but if I don't call that, I get "unexpected end of stream" type errors instead, with no additional error anywhere to tell me why.)

I have set breakpoints inside ServerTypeConvertorFactory and it seems that none of the methods are being called on the server.  The same breakpoints show the client calling convert() when the server hands back the result, but the result is already the correct type due to serialisation magic so I don't need to convert it.

Essentially, what I am trying to do is to implement a wire protocol which conforms to standard XML-RPC (and doesn't use huge amounts of Base64 data...) while still having an API which doesn't require a thousand casts and calls to Map.get().  I also want to avoid having to make more calls than necessary, which is why I'm returning a bean instead of having separate methods to get each property of it, which would have worked too.

(Also, if there is a simpler to use API than this one, I'm open for suggestions.  It started out being really easy, but that's until you need to customise it.  Also, anyone suggesting Axis or other SOAP-based APIs will be shot at dawn.)


问:
Invalid product identifier error in ios Objective C SKPayment even after I give valid identifier
I get the error invalid identifier even after I give valid identifier to SKPayment, I have double checked the Identifier it is the same as i am using in code. What could be the problem here? Here is my code.

```<code>#import "MKStoreManager.h"
#import "Global.h"
#import <Parse/Parse.h>
#import <StoreKit/StoreKit.h>

@implementation MKStoreManager

@synthesize purchasableObjects;
@synthesize storeObserver;

static NSString *feature0Id = @"example";

BOOL feature0Purchased;

static MKStoreManager* _sharedStoreManager; // self

- (instancetype)init
{
  self = [super init];
  if (self) {
    [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
  }
  return self;
}

//- (void)dealloc {
//    [super dealloc];
//    [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];
//}

-(void)restorePurchase {
    [self showLoader];
    if ([SKPaymentQueue canMakePayments]) {
            [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
        }
}
- (void)showLoader{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 300 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
        self->HUD = [MBProgressHUD showHUDAddedTo:_objSetting.view animated:YES];
        self->HUD.delegate = (id<MBProgressHUDDelegate>)_objSetting;
        [self->HUD setLabelFont:[UIFont systemFontOfSize:12]];
        [self->HUD setLabelText:@"Loading..."];
        [self->HUD setTaskInProgress:YES];
        [self->HUD show:true];
    });
}

+ (BOOL) feature0Purchased {
    return feature0Purchased;
}

+ (MKStoreManager*)sharedManager
{
    NSLog(@"pass sharedManager");
    @synchronized(self) {

        if (_sharedStoreManager == nil) {

            [[self alloc] init]; // assignment not done here
            _sharedStoreManager.purchasableObjects = [[NSMutableArray alloc] init];
            [_sharedStoreManager requestProductData];

            [MKStoreManager loadPurchases];
            _sharedStoreManager.storeObserver = [[MKStoreObserver alloc] init];
            [[SKPaymentQueue defaultQueue] addTransactionObserver:_sharedStoreManager.storeObserver];
        }
    }
    return _sharedStoreManager;
}

#pragma mark Singleton Methods

+ (id)allocWithZone:(NSZone *)zone
{
    @synchronized(self) {

        if (_sharedStoreManager == nil) {

            _sharedStoreManager = [super allocWithZone:zone];
            return _sharedStoreManager;  // assignment and return on first allocation
        }
    }

    return nil; //on subsequent allocation attempts return nil
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

- (void) requestProductData
{
    SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:
                                 [NSSet setWithObjects: feature0Id, nil]];

    request.delegate = self;
    [request start];
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{

    [purchasableObjects addObjectsFromArray:response.products];
    NSLog(@"product invalid %@", response.invalidProductIdentifiers);
    for(int i=0;i<[purchasableObjects count];i++)
    {
        SKProduct *product = [purchasableObjects objectAtIndex:i];
        NSLog(@"Feature: %@, Cost: %f, ID: %@",[product localizedTitle],
              [[product price] doubleValue], [product productIdentifier]);

    }
}
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error{
    NSLog(@"Error %@", error);
    [self->HUD hide:YES];
}

- (void) buyFeature0 {
    [self showLoader];
    [self buyFeature:feature0Id];
}

- (void) buyFeature:(NSString*) featureId
{
    if ([SKPaymentQueue canMakePayments]) {
        SKPayment *payment = [SKPayment paymentWithProductIdentifier:featureId];
        [[SKPaymentQueue defaultQueue] addPayment:payment];
    } else {
        [self->HUD hide:YES];
        [CommonAlertController showAlert:@"PenguinWings" message:@"You are not authorized to purchase from AppStore" buttons:@[@"OK"] forVC: nil handler:^(UIAlertAction * _Nonnull action) {
        }];
    }
}

- (void) failedTransaction: (SKPaymentTransaction *)transaction
{

//    [self->HUD hide:YES];

    if ([transaction.error localizedFailureReason] != nil && [transaction.error localizedRecoverySuggestion] != nil) {
        [self->HUD hide:YES];
        NSString *messageToBeShown = [NSString stringWithFormat:@"Reason: %@, You can try: %@", [transaction.error localizedFailureReason], [transaction.error localizedRecoverySuggestion]];
        [CommonAlertController showAlert:@"Unable to complete your purchase" message:messageToBeShown buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
        }];
    } else {
        [self->HUD hide:YES];
        NSString *messageToBeShown = [NSString stringWithFormat:@"Reason: %@,Please try again later.", [transaction.error localizedDescription]];
        [CommonAlertController showAlert:@"Unable to complete your purchase" message: messageToBeShown buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
        }];
    }

}

-(void) provideContent: (NSString*) productIdentifier
{
    if([productIdentifier isEqualToString:feature0Id])
        feature0Purchased = YES;

    [MKStoreManager updatePurchases];

    PFUser *user = [PFUser currentUser];
    user[kPFField_Buy] = [NSNumber numberWithBool:YES];
    [user save];
    [self->HUD hide:true];
    [CommonAlertController showAlert:nil message:@"Purchase Successful!" buttons:@[@"Ok"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
    }];
}

+(void) loadPurchases
{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    feature0Purchased = [userDefaults boolForKey:feature0Id];
}

+(void) updatePurchases
{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    [userDefaults setBool:feature0Purchased forKey:feature0Id];
}

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray<SKPaymentTransaction *> *)transactions {
    for (SKPaymentTransaction *transaction in transactions) {
        switch (transaction.transactionState) {
            case SKPaymentTransactionStateRestored:
                // The purchase has been restored, so finish the transaction and provide the purchased content to the user.
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                // Provide the purchased content to the user.
                [self->HUD hide:YES];
                [CommonAlertController showAlert:@"Transaction Completed" message: @"Your purchase has been restored." buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
                }];
                break;
            case SKPaymentTransactionStateFailed:

                [self->HUD hide:YES];
                // The transaction failed, so finish it and show an error to the user.
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                // Show an error to the user.
//                [self->HUD hide:YES];
                NSString *message = [NSString stringWithFormat:@"Reason: %@,Please try again later.", [transaction.error localizedDescription]];
                [CommonAlertController showAlert:@"Transaction Failed" message: message buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
                }];
                break;
            default:
                break;
        }
    }
}

- (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error {
    // An error occurred while restoring the purchases, so show an error to the user.
    // Show an error to the user.
    [self->HUD hide:YES];
    NSString *message = [NSString stringWithFormat:@"Reason: %@,Please try again later.", [error localizedDescription]];
    [CommonAlertController showAlert:@"Transaction Failed" message: message buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
    }];
}

@end
</code>```

I have tried Double checking the identifier. and many more solutions available online like cleaning build checking bundle identifier in p list etc.

Body:
I get the error invalid identifier even after I give valid identifier to SKPayment, I have double checked the Identifier it is the same as i am using in code. What could be the problem here? Here is my code.

#import "MKStoreManager.h"
#import "Global.h"
#import <Parse/Parse.h>
#import <StoreKit/StoreKit.h>

@implementation MKStoreManager

@synthesize purchasableObjects;
@synthesize storeObserver;

static NSString *feature0Id = @"example";

BOOL feature0Purchased;

static MKStoreManager* _sharedStoreManager; // self

- (instancetype)init
{
  self = [super init];
  if (self) {
    [[SKPaymentQueue defaultQueue] addTransactionObserver:self];
  }
  return self;
}

//- (void)dealloc {
//    [super dealloc];
//    [[SKPaymentQueue defaultQueue] removeTransactionObserver:self];
//}

-(void)restorePurchase {
    [self showLoader];
    if ([SKPaymentQueue canMakePayments]) {
            [[SKPaymentQueue defaultQueue] restoreCompletedTransactions];
        }
}
- (void)showLoader{
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 300 * NSEC_PER_MSEC), dispatch_get_main_queue(), ^{
        self->HUD = [MBProgressHUD showHUDAddedTo:_objSetting.view animated:YES];
        self->HUD.delegate = (id<MBProgressHUDDelegate>)_objSetting;
        [self->HUD setLabelFont:[UIFont systemFontOfSize:12]];
        [self->HUD setLabelText:@"Loading..."];
        [self->HUD setTaskInProgress:YES];
        [self->HUD show:true];
    });
}

+ (BOOL) feature0Purchased {
    return feature0Purchased;
}

+ (MKStoreManager*)sharedManager
{
    NSLog(@"pass sharedManager");
    @synchronized(self) {

        if (_sharedStoreManager == nil) {

            [[self alloc] init]; // assignment not done here
            _sharedStoreManager.purchasableObjects = [[NSMutableArray alloc] init];
            [_sharedStoreManager requestProductData];

            [MKStoreManager loadPurchases];
            _sharedStoreManager.storeObserver = [[MKStoreObserver alloc] init];
            [[SKPaymentQueue defaultQueue] addTransactionObserver:_sharedStoreManager.storeObserver];
        }
    }
    return _sharedStoreManager;
}

#pragma mark Singleton Methods

+ (id)allocWithZone:(NSZone *)zone
{
    @synchronized(self) {

        if (_sharedStoreManager == nil) {

            _sharedStoreManager = [super allocWithZone:zone];
            return _sharedStoreManager;  // assignment and return on first allocation
        }
    }

    return nil; //on subsequent allocation attempts return nil
}

- (id)copyWithZone:(NSZone *)zone
{
    return self;
}

- (void) requestProductData
{
    SKProductsRequest *request= [[SKProductsRequest alloc] initWithProductIdentifiers:
                                 [NSSet setWithObjects: feature0Id, nil]];

    request.delegate = self;
    [request start];
}

- (void)productsRequest:(SKProductsRequest *)request didReceiveResponse:(SKProductsResponse *)response
{

    [purchasableObjects addObjectsFromArray:response.products];
    NSLog(@"product invalid %@", response.invalidProductIdentifiers);
    for(int i=0;i<[purchasableObjects count];i++)
    {
        SKProduct *product = [purchasableObjects objectAtIndex:i];
        NSLog(@"Feature: %@, Cost: %f, ID: %@",[product localizedTitle],
              [[product price] doubleValue], [product productIdentifier]);

    }
}
- (void)request:(SKRequest *)request didFailWithError:(NSError *)error{
    NSLog(@"Error %@", error);
    [self->HUD hide:YES];
}

- (void) buyFeature0 {
    [self showLoader];
    [self buyFeature:feature0Id];
}

- (void) buyFeature:(NSString*) featureId
{
    if ([SKPaymentQueue canMakePayments]) {
        SKPayment *payment = [SKPayment paymentWithProductIdentifier:featureId];
        [[SKPaymentQueue defaultQueue] addPayment:payment];
    } else {
        [self->HUD hide:YES];
        [CommonAlertController showAlert:@"PenguinWings" message:@"You are not authorized to purchase from AppStore" buttons:@[@"OK"] forVC: nil handler:^(UIAlertAction * _Nonnull action) {
        }];
    }
}

- (void) failedTransaction: (SKPaymentTransaction *)transaction
{

//    [self->HUD hide:YES];

    if ([transaction.error localizedFailureReason] != nil && [transaction.error localizedRecoverySuggestion] != nil) {
        [self->HUD hide:YES];
        NSString *messageToBeShown = [NSString stringWithFormat:@"Reason: %@, You can try: %@", [transaction.error localizedFailureReason], [transaction.error localizedRecoverySuggestion]];
        [CommonAlertController showAlert:@"Unable to complete your purchase" message:messageToBeShown buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
        }];
    } else {
        [self->HUD hide:YES];
        NSString *messageToBeShown = [NSString stringWithFormat:@"Reason: %@,Please try again later.", [transaction.error localizedDescription]];
        [CommonAlertController showAlert:@"Unable to complete your purchase" message: messageToBeShown buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
        }];
    }

}

-(void) provideContent: (NSString*) productIdentifier
{
    if([productIdentifier isEqualToString:feature0Id])
        feature0Purchased = YES;

    [MKStoreManager updatePurchases];

    PFUser *user = [PFUser currentUser];
    user[kPFField_Buy] = [NSNumber numberWithBool:YES];
    [user save];
    [self->HUD hide:true];
    [CommonAlertController showAlert:nil message:@"Purchase Successful!" buttons:@[@"Ok"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
    }];
}

+(void) loadPurchases
{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    feature0Purchased = [userDefaults boolForKey:feature0Id];
}

+(void) updatePurchases
{
    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    [userDefaults setBool:feature0Purchased forKey:feature0Id];
}

- (void)paymentQueue:(SKPaymentQueue *)queue updatedTransactions:(NSArray<SKPaymentTransaction *> *)transactions {
    for (SKPaymentTransaction *transaction in transactions) {
        switch (transaction.transactionState) {
            case SKPaymentTransactionStateRestored:
                // The purchase has been restored, so finish the transaction and provide the purchased content to the user.
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                // Provide the purchased content to the user.
                [self->HUD hide:YES];
                [CommonAlertController showAlert:@"Transaction Completed" message: @"Your purchase has been restored." buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
                }];
                break;
            case SKPaymentTransactionStateFailed:

                [self->HUD hide:YES];
                // The transaction failed, so finish it and show an error to the user.
                [[SKPaymentQueue defaultQueue] finishTransaction:transaction];
                // Show an error to the user.
//                [self->HUD hide:YES];
                NSString *message = [NSString stringWithFormat:@"Reason: %@,Please try again later.", [transaction.error localizedDescription]];
                [CommonAlertController showAlert:@"Transaction Failed" message: message buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
                }];
                break;
            default:
                break;
        }
    }
}

- (void)paymentQueue:(SKPaymentQueue *)queue restoreCompletedTransactionsFailedWithError:(NSError *)error {
    // An error occurred while restoring the purchases, so show an error to the user.
    // Show an error to the user.
    [self->HUD hide:YES];
    NSString *message = [NSString stringWithFormat:@"Reason: %@,Please try again later.", [error localizedDescription]];
    [CommonAlertController showAlert:@"Transaction Failed" message: message buttons:@[@"OK"] forVC:nil handler:^(UIAlertAction * _Nonnull action) {
    }];
}

@end

I have tried Double checking the identifier. and many more solutions available online like cleaning build checking bundle identifier in p list etc.


问:
java.lang.ExceptionInInitializerError while running mvn clean install
While running mvn clean install I am getting these errors:

```<code>java.lang.ExceptionInInitializerError
        at abcConverterTest.setup(abcConverterTest.java:33)
Caused by: org.apache.kafka.common.KafkaException: Failed to construct kafka producer
        at abcConverterTest.setup(abcConverterTest.java:33)
Caused by: org.apache.kafka.common.config.ConfigException: Invalid url in bootstrap.servers:     ${env:GRAYLOG_BOOTSTRAP_SERVER} at abcConverterTest.setup(abcConverterTest.java:33)
</code>```
```<code>class abcConverterTest {

    private abcConverter abcConverter;
    @Mock private ObjectMapper objectMapper;
    private static final String value = "xyz";
    List<Object> detailsList = new ArrayList<>();
    Map<String, Object> details = new HashMap<>();
    Map<String, Object> details2 = new HashMap<>();
    Map<String, Object> details3 = new HashMap<>();

    @BeforeEach
    public void setup() {
        MockitoAnnotations.initMocks(this);
        this.abcConverter = new abcConverter(objectMapper); // this is line 33

        details.put("key", "abcd");
        details.put("value", "pqrs");

        details2.put("key", "abcd1");
        details2.put("value", "pqrs1");

        details3.put("key", "abcd2");
        details3.put("value", "pqrs2");

        detailsList.add(details);
        detailsList.add(details2);
        detailsList.add(details3);
    }

    @Test
    void testConvertArguements() {
        String result = abcConverter.convertToColumn(null);
        Assertions.assertNull(result);
    }
}
</code>```
```<code>@Slf4j
@Component
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class abcConverter implements AttributeConverter<List<Object>, String> {

    private final ObjectMapper objectMapper;
    ......
    ......

}
</code>```

I was trying to run test cases, its working fine when I am running test cases individually (adding GRAYLOG_BOOTSTRAP_SERVER=some_value in config) .
but failing when running mvn clean install

Body:
While running mvn clean install I am getting these errors:

java.lang.ExceptionInInitializerError
        at abcConverterTest.setup(abcConverterTest.java:33)
Caused by: org.apache.kafka.common.KafkaException: Failed to construct kafka producer
        at abcConverterTest.setup(abcConverterTest.java:33)
Caused by: org.apache.kafka.common.config.ConfigException: Invalid url in bootstrap.servers:     ${env:GRAYLOG_BOOTSTRAP_SERVER} at abcConverterTest.setup(abcConverterTest.java:33)

class abcConverterTest {

    private abcConverter abcConverter;
    @Mock private ObjectMapper objectMapper;
    private static final String value = "xyz";
    List<Object> detailsList = new ArrayList<>();
    Map<String, Object> details = new HashMap<>();
    Map<String, Object> details2 = new HashMap<>();
    Map<String, Object> details3 = new HashMap<>();

    @BeforeEach
    public void setup() {
        MockitoAnnotations.initMocks(this);
        this.abcConverter = new abcConverter(objectMapper); // this is line 33

        details.put("key", "abcd");
        details.put("value", "pqrs");

        details2.put("key", "abcd1");
        details2.put("value", "pqrs1");

        details3.put("key", "abcd2");
        details3.put("value", "pqrs2");

        detailsList.add(details);
        detailsList.add(details2);
        detailsList.add(details3);
    }

    @Test
    void testConvertArguements() {
        String result = abcConverter.convertToColumn(null);
        Assertions.assertNull(result);
    }
}

@Slf4j
@Component
@RequiredArgsConstructor(onConstructor_ = @Autowired)
public class abcConverter implements AttributeConverter<List<Object>, String> {

    private final ObjectMapper objectMapper;
    ......
    ......

}

I was trying to run test cases, its working fine when I am running test cases individually (adding GRAYLOG_BOOTSTRAP_SERVER=some_value in config) .
but failing when running mvn clean install


问:
Using sentry to capture network traffic and show on my custom page
I want to use sentry.io to capture logs and network traffic from a webpage. I can see the details on sentry dashboard. But is there any way to show this info in my own custom page web page, something like


问:
PyQt6 application on High DPI Windows screen: why are only QMessageBox fonts so huge?
I am writing a basic PyQt6 application using Python 3.10.4 and PyQt 6.4.0 on Windows 10 where the display resolution is 3840 x 2160 and text is scaled 225% by Windows. I noticed that fonts on the rest of my GUI screen look ok (properly scaled), wheras QMessageBox fonts are really huge.

Here is my code

```<code>import sys

from PyQt6.QtCore import PYQT_VERSION_STR
from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QPushButton, QMessageBox

class MainWindow(QWidget):
    def __init__(self, parent: QWidget = None):
        super(MainWindow, self).__init__(parent)
        self.initializeUi()

    def initializeUi(self):
        self.setWindowTitle(f"Welcome PyQt")
        self.setupMainWindow()

    def setupMainWindow(self):
        """ setup widgets & connect signals/slots """
        hello_label = QLabel("Click the button below for important message")
        hello = QPushButton("Click me!")
        hello.clicked.connect(self.sayHello)
        layout = QVBoxLayout()
        layout.addWidget(hello_label)
        layout.addWidget(hello)
        self.setLayout(layout)

    def sayHello(self):
        QMessageBox.information(self, "Hello", f"Hello, welcome to PyQt {PYQT_VERSION_STR}")

def main():
    app = QApplication(sys.argv)
    app.setStyle("Fusion")

    # create the main window
    win = MainWindow()
    win.show()

    sys.exit(app.exec())

if __name__ == "__main__":
    main()
</code>```

Here is the GUI displayed when I run the above code

Output of above code

When I click the button, here is the QMessageBox displayed - notice how huge the font is

QMessageBox using PyQt6

Here is my Windows display setting

Windows Display Settings

Question is why are fonts so huge only in QMessageBox? The strange part is, if I change the import lines PyQt6... import to from PyQt5... import (so that I am using PyQt5) and run the code, this is the QMessageBox I see, where fonts are the same size as rest of GUI

QMessageBox using PyQt5

Am I missing something, or is this a bug in PyQt6 (on Windows)?

NOTE: I see the same result when I run code from Visual Studio Code, or PyCharm or the command line - so the IDE is not doing anything odd.

Body:
I am writing a basic PyQt6 application using Python 3.10.4 and PyQt 6.4.0 on Windows 10 where the display resolution is 3840 x 2160 and text is scaled 225% by Windows. I noticed that fonts on the rest of my GUI screen look ok (properly scaled), wheras QMessageBox fonts are really huge.

Here is my code

import sys

from PyQt6.QtCore import PYQT_VERSION_STR
from PyQt6.QtWidgets import QApplication, QWidget, QVBoxLayout, QLabel, QPushButton, QMessageBox

class MainWindow(QWidget):
    def __init__(self, parent: QWidget = None):
        super(MainWindow, self).__init__(parent)
        self.initializeUi()

    def initializeUi(self):
        self.setWindowTitle(f"Welcome PyQt")
        self.setupMainWindow()

    def setupMainWindow(self):
        """ setup widgets & connect signals/slots """
        hello_label = QLabel("Click the button below for important message")
        hello = QPushButton("Click me!")
        hello.clicked.connect(self.sayHello)
        layout = QVBoxLayout()
        layout.addWidget(hello_label)
        layout.addWidget(hello)
        self.setLayout(layout)

    def sayHello(self):
        QMessageBox.information(self, "Hello", f"Hello, welcome to PyQt {PYQT_VERSION_STR}")

def main():
    app = QApplication(sys.argv)
    app.setStyle("Fusion")

    # create the main window
    win = MainWindow()
    win.show()

    sys.exit(app.exec())

if __name__ == "__main__":
    main()

Here is the GUI displayed when I run the above code

Output of above code

When I click the button, here is the QMessageBox displayed - notice how huge the font is

QMessageBox using PyQt6

Here is my Windows display setting

Windows Display Settings

Question is why are fonts so huge only in QMessageBox? The strange part is, if I change the import lines PyQt6... import to from PyQt5... import (so that I am using PyQt5) and run the code, this is the QMessageBox I see, where fonts are the same size as rest of GUI

QMessageBox using PyQt5

Am I missing something, or is this a bug in PyQt6 (on Windows)?

NOTE: I see the same result when I run code from Visual Studio Code, or PyCharm or the command line - so the IDE is not doing anything odd.


问:
Compute node not showing as hypervisor in openstack
I am trying to manually install Openstack Yoga in virtual environment (Rocky Linux 9). I am struggling to bring my compute node in the * Openstack hypervisor list*. Following this guide to install Openstack yoga.

I have carefully followed the instructions many times and have watched many videos on youtube too, but, no luck. I will really appreciate if someone can assist. Don't want to give up.

compute1 host shows up as the compute host in the Horizon and with the following command, however, there is nothing listed under the hypervisor list.

```<code>[root@controller ~]# openstack compute service list
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+
| ID                                   | Binary         | Host       | Zone     | Status  | State | Updated At                 |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+
| bce48397-8111-49fe-9b05-9cdd4d24a229 | nova-scheduler | controller | internal | enabled | up    | 2022-12-30T06:20:05.000000 |
| c4a75344-88d4-4cc2-b63a-7e1820069dbd | nova-conductor | controller | internal | enabled | up    | 2022-12-30T06:20:05.000000 |
| 30f7698f-a684-4b1d-9eed-351d587b32c4 | nova-compute   | compute1   | nova     | enabled | up    | 2022-12-30T06:19:57.000000 |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+
</code>```

[root@controller ~]# openstack hypervisor list #returns nothing.

```<code> [root@controller ~]# nova-status upgrade check

+--------------------------------------------------------------------+
| Upgrade Check Results                                              |
+--------------------------------------------------------------------+
| Check: Cells v2                                                    |
| Result: Success                                                    |
| Details: No host mappings or compute nodes were found. Remember to |
|   run command 'nova-manage cell_v2 discover_hosts' when new        |
|   compute hosts are deployed.                                      |
</code>```

When trying to discover the nodes, getting the following message

```<code>[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': fe28e42c-493f-48e5-956d-9f5494a99df6
Found 0 unmapped computes in cell: fe28e42c-493f-48e5-956d-9f5494a99df6
</code>```

Am I missing something? Should I install any additional packages, which are not listed in the guide?

Compute Node Nova Configuration
https://pastebin.com/6dhkCeW0

Body:
I am trying to manually install Openstack Yoga in virtual environment (Rocky Linux 9). I am struggling to bring my compute node in the * Openstack hypervisor list*. Following this guide to install Openstack yoga.

I have carefully followed the instructions many times and have watched many videos on youtube too, but, no luck. I will really appreciate if someone can assist. Don't want to give up.

compute1 host shows up as the compute host in the Horizon and with the following command, however, there is nothing listed under the hypervisor list.

[root@controller ~]# openstack compute service list
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+
| ID                                   | Binary         | Host       | Zone     | Status  | State | Updated At                 |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+
| bce48397-8111-49fe-9b05-9cdd4d24a229 | nova-scheduler | controller | internal | enabled | up    | 2022-12-30T06:20:05.000000 |
| c4a75344-88d4-4cc2-b63a-7e1820069dbd | nova-conductor | controller | internal | enabled | up    | 2022-12-30T06:20:05.000000 |
| 30f7698f-a684-4b1d-9eed-351d587b32c4 | nova-compute   | compute1   | nova     | enabled | up    | 2022-12-30T06:19:57.000000 |
+--------------------------------------+----------------+------------+----------+---------+-------+----------------------------+

[root@controller ~]# openstack hypervisor list #returns nothing.

 [root@controller ~]# nova-status upgrade check

+--------------------------------------------------------------------+
| Upgrade Check Results                                              |
+--------------------------------------------------------------------+
| Check: Cells v2                                                    |
| Result: Success                                                    |
| Details: No host mappings or compute nodes were found. Remember to |
|   run command 'nova-manage cell_v2 discover_hosts' when new        |
|   compute hosts are deployed.                                      |

When trying to discover the nodes, getting the following message

[root@controller ~]# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
Found 2 cell mappings.
Skipping cell0 since it does not contain hosts.
Getting computes from cell 'cell1': fe28e42c-493f-48e5-956d-9f5494a99df6
Found 0 unmapped computes in cell: fe28e42c-493f-48e5-956d-9f5494a99df6

Am I missing something? Should I install any additional packages, which are not listed in the guide?

Compute Node Nova Configuration
https://pastebin.com/6dhkCeW0


问:
How to implement paging3 in mvvm architecture in android
I am following mvvm architecture with kotlin coroutine , how we can implement paging 3

I tried without paging but not satisficed i want to implement this


问:
Using gradle-enterprise-maven-extension to find runtime classpath/non-normalized line endings
Below I can see that during every build due to runtime classpath and non-normalized line endings, I'm getting different cache keys, which causes the build to not use the cache.

I tried adding everything to ignore, but that doesn't seem to be working. How can I figure out the exact files that have weird line endings and different classpaths, so I don't have to keep guessing?

```<code><paths>
  <path>src/test/resources</path>
  <path>src/main/resources</path>
  <path>src/test/java</path>
</paths>
<normalization>
  <strategy>RELATIVE_PATH</strategy>.
  <ignoreLineEndings>true</ignoreLineEndings>
</normalization>

<runtimeClassPath>
  <ignoredFiles>
    <ignoredFile>src/test/**</ignoredFile>
    <ignoredFile>src/main/**</ignoredFile>
  </ignoredFiles>
</runtimeClassPath>
</code>```

These are the docs I've been using https://docs.gradle.com/enterprise/maven-extension/#finding_the_cause_of_cache_misses

Body:
Below I can see that during every build due to runtime classpath and non-normalized line endings, I'm getting different cache keys, which causes the build to not use the cache.

I tried adding everything to ignore, but that doesn't seem to be working. How can I figure out the exact files that have weird line endings and different classpaths, so I don't have to keep guessing?

<paths>
  <path>src/test/resources</path>
  <path>src/main/resources</path>
  <path>src/test/java</path>
</paths>
<normalization>
  <strategy>RELATIVE_PATH</strategy>.
  <ignoreLineEndings>true</ignoreLineEndings>
</normalization>

<runtimeClassPath>
  <ignoredFiles>
    <ignoredFile>src/test/**</ignoredFile>
    <ignoredFile>src/main/**</ignoredFile>
  </ignoredFiles>
</runtimeClassPath>

These are the docs I've been using https://docs.gradle.com/enterprise/maven-extension/#finding_the_cause_of_cache_misses


问:
Convert simple JavaScript to React Js
This is plain JavaScript. I want to write this in React Js. Can anyone please help me.</p>
```<code>  $("#CertificateModal").on('hidden.bs.modal', function (e) {
    $("#CertificateModal iframe").attr("src", $("#CertificateModal iframe").attr("src"));
});
</code>```
```<code>  $("#CertificateModal").on('hidden.bs.modal', function (e) {
    $("#CertificateModal iframe").attr("src", $("#CertificateModal iframe").attr("src"));
});
</code>```

Title: Convert simple JavaScript to React Js

Body:
This is plain JavaScript. I want to write this in React Js. Can anyone please help me.

  $("#CertificateModal").on('hidden.bs.modal', function (e) {
    $("#CertificateModal iframe").attr("src", $("#CertificateModal iframe").attr("src"));
});

  $("#CertificateModal").on('hidden.bs.modal', function (e) {
    $("#CertificateModal iframe").attr("src", $("#CertificateModal iframe").attr("src"));
});


问:
Spark Aggregator Is Slow At ObjectHashAggregate
We have a spark app that does some customized aggregation on our data. And we've created a Spark Aggregator to do it, which is basically extending the org.apache.spark.sql.expressions.Aggregator  and calling it through a UDAF. These aggregators basically defines a pre-aggregate process so that executors could process the data at local first and then go to exchange phase, which is pretty sweet. More on them could be found here https://spark.apache.org/docs/latest/sql-ref-functions-udf-aggregate.html

Now my question is, I've noticed that for these aggregators, the second ObjectHashAggregate process is always much much slower than the first partial ObjectHashAggregate. For example in the screenshot I've attached, the second ObjectHashAggregate is significantly slower than the first one. SparkJobScreenShot

However in our code both of them should be running kinda the same aggregation methods on the data or on the intermediate results. So why is it the second one is much slower than the first one? Is it because the hashing and exchanging after the first ObjectHashAggregate? I'm not really sure what could be causing Spark with such behavior.


问:
Flutterfire web - PlatformException issue on Production site
I integrated firebase_core and firebase_analytics into my flutter web project. Everything is working fine when running in localhost but after I deployed to production site, the firebase stop working and exception was catch using try catch.

PlatformException(channel-error, Unable to establish connection on channel., null, null)

Here is my firebase version in pubspec.yaml

```<code>  firebase_core: ^2.4.1
  firebase_analytics: ^10.1.0
</code>```

Here is my code when initialized firebase

```<code>void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  try {
    await Firebase.initializeApp(
      options: DefaultFirebaseOptions.currentPlatform,
    );
  } catch (e) {
    debugPrint('Firebase Error : $e');
  }

  setPathUrlStrategy();
  runApp(const MyApp());
}
</code>```

I followed every instruction at the firebase official doc and even redo the entire firebase installation again but the problem still existed. I have searched in stackoverflow and the flutterfire github, so far no solution for my problem here.

Does anyone know what is going on with my firebase integration?

Body:
I integrated firebase_core and firebase_analytics into my flutter web project. Everything is working fine when running in localhost but after I deployed to production site, the firebase stop working and exception was catch using try catch.

PlatformException(channel-error, Unable to establish connection on channel., null, null)

Here is my firebase version in pubspec.yaml

  firebase_core: ^2.4.1
  firebase_analytics: ^10.1.0

Here is my code when initialized firebase

void main() async {
  WidgetsFlutterBinding.ensureInitialized();

  try {
    await Firebase.initializeApp(
      options: DefaultFirebaseOptions.currentPlatform,
    );
  } catch (e) {
    debugPrint('Firebase Error : $e');
  }

  setPathUrlStrategy();
  runApp(const MyApp());
}

I followed every instruction at the firebase official doc and even redo the entire firebase installation again but the problem still existed. I have searched in stackoverflow and the flutterfire github, so far no solution for my problem here.

Does anyone know what is going on with my firebase integration?


问:
C++ Updating reference variable pointer to another location
Here is my simple code

```<code>#include <iostream>
#include <string>

using namespace std;

int main() {

    string food = "Pizza";
    string &meal = food;

    string okay = "okay";

    &meal = okay; // showing error in updating meal reference

    cout << food << "\n";  // Outputs should be Pizza
    cout << meal << "\n";  // Outputs Should be okay
    return 0;
}
</code>```

I reference have a meal variable to the same location as food so now the meal value is Pizza but now I want to update the meal reference location to okay such that the food value is still Pizza but the meal updated to okay.

is there any way to update the reference variable to another variable?

Body:
Here is my simple code

#include <iostream>
#include <string>

using namespace std;

int main() {

    string food = "Pizza";
    string &meal = food;

    string okay = "okay";

    &meal = okay; // showing error in updating meal reference

    cout << food << "\n";  // Outputs should be Pizza
    cout << meal << "\n";  // Outputs Should be okay
    return 0;
}

I reference have a meal variable to the same location as food so now the meal value is Pizza but now I want to update the meal reference location to okay such that the food value is still Pizza but the meal updated to okay.

is there any way to update the reference variable to another variable?


问:
Is it possible to analyze the types of transaction isolation issues?
I'm taking care of a web application which uses Postgres and the SERIALIZABLE transaction isolation level. I am thinking about reducing the transaction isolation level REPEATABLE_READ. Is there a way to analyze current logs to see if there were issues that were already prevented by having SERIALIZABLE instead of REPEATABLE_READ?

In my logs, I see those kinds of issues:

```<code>A) could not serialize access due to concurrent update
B) could not serialize access due to read/write dependencies among transactions
   DETAIL:  Reason code: Canceled on conflict out to pivot 13059031, during read.
C) could not serialize access due to read/write dependencies among transactions
   DETAIL:  Reason code: Canceled on identification as a pivot, during write.
D) could not serialize access due to read/write dependencies among transactions
   DETAIL:  Reason code: Canceled on identification as a pivot, during conflict out
   checking.
</code>```

Is maybe one of them only caused by serialization anomalies?

Body:
I'm taking care of a web application which uses Postgres and the SERIALIZABLE transaction isolation level. I am thinking about reducing the transaction isolation level REPEATABLE_READ. Is there a way to analyze current logs to see if there were issues that were already prevented by having SERIALIZABLE instead of REPEATABLE_READ?

In my logs, I see those kinds of issues:

A) could not serialize access due to concurrent update
B) could not serialize access due to read/write dependencies among transactions
   DETAIL:  Reason code: Canceled on conflict out to pivot 13059031, during read.
C) could not serialize access due to read/write dependencies among transactions
   DETAIL:  Reason code: Canceled on identification as a pivot, during write.
D) could not serialize access due to read/write dependencies among transactions
   DETAIL:  Reason code: Canceled on identification as a pivot, during conflict out
   checking.

Is maybe one of them only caused by serialization anomalies?