text:
Q: Hiding a series by default in a spider plot I have a spider plot in using the graphing library of Dojo defined like this:
require([
    "dojox/charting/Chart",
    "dojox/charting/themes/Claro",
    "dojox/charting/plot2d/Spider",
    "dojox/charting/action2d/Tooltip",
    "dojox/charting/widget/SelectableLegend",
    "dojox/charting/axis2d/Default"
    ], function (Chart, theme, Spider, Tooltip, Legend, Default) {
        var chart = new Chart(element).setTheme(theme).addPlot("default", {
            type: Spider,
            radius: 200,
            fontColor: "black",
            labelOffset: "-20"
        });
        var colors = ["blue", "red", "green", "yellow", "purple", "orange", "teal",
                    "maroon", "olive", "lime", "aqua", "fuchsia"];
        $.each(factors, function (index, factor) {
            chart.addAxis(factor.name, {
                 type: Default,
                 min: factor.min,
                 max: factor.max
             });
        });
        $.each(presets, function (pIndex, preset) {
            var data = [];
            $.each(factors, function (fIndex, factor) {
                 data[factor.name] = preset.values[fIndex];
            });
            chart.addSeries(preset.short, data, {
                 fill: colors[pIndex % colors.length]
            });
        });
        new Tooltip(chart, "default");
        chart.render();
        new Legend({
            chart: chart,
            horizontal: false
        }, $(element).next(".legend")[0]);
    });

I add a series for every member of an array called presets and I use a selectable legend that lets the user turn them on or off as they want. However, what I can't seem to find in the docs is how to start a series in the unselected, not visible state? What I ideally want to do is cap the number of series visible when the page loads because in some cases I have up to 14 presets and it just looks a mess until the user deselects a bunch. So I'd like to have, say, every preset above the first 5 be hidden at the start.
Here's a crude fiddle I've knocked to demonstrate. What I want is to have some of the series unselected when the plot is first displayed.
Update: I tried adding this after adding my series:
var checkboxes = $(".dijitCheckBoxInput").each((index, elem) => {
     if (index > 4) {
         elem.click();
     }
});

Which works, but seems very fragile. If they change the class assigned to checkboxes, it'll break. Also, it prohibits me using more than one set of dojo checkboxes because I don't have a good way to tell the difference. (Note, the IDs of the checkboxes added by the SelectableLegend are dijit_form_CheckBox_0, dijit_form_CheckBox_1, etc, which also gives no useful information as to what they are related to). I thought I might be able to use the legend placeholder div as a way to select the descendant checkboxes, but it appears that Dojo replaces the placeholder entirely with a table.

A: dojox/charting/Series has an attribute called dirty which according to the API docs is a "flag indicating whether or not this element needs to be rendered".
Alternately, if you are limiting the display of some series you can write a separate interface for adding them. For example, loop over the first 5. Then create a select box or list of check boxes with all entries and an onchange event that calls chart.addSeries.
Keeping a reference to each series you create will allow you to later call destroy() or destroyRecursive() on it if the user no longer wishes it displayed.
So while ideally you could toggle the display of these series, the worst case senerio is that you just add, destroy, and read based on some user input.
Using a templated widget will allow you to keep this interface and the chart tightly linked and support reuse.
BTW, consider using "dojo/_base/array" and "dojo/query" in place of the jquery

A: I have updated your code http://jsfiddle.net/92Dzv/18/
Here is the key to toogle.
dom.byId(le._cbs[0].id).click();
dom.byId(le._cbs[2].id).click();

Choose the index of your legend and set to _cbs.
By this way le._cbs[0].id you will get the real id of checkbox (that inside in the widget) and then just use click()
Note : le is came from here.
var le = new Legend({
                chart: chart,
                horizontal: false
             }, legend);

A: i looked into the dojo code and found the area in which the shapes are toggled on & off whitin the SelectableLegend.js :

          var legendCheckBox = query(".dijitCheckBox", legend)[0];
          hub.connect(legendCheckBox, "onclick", this, function(e){
              this._toggle(shapes, i, legend.vanished, originalDyn, seriesName, plotName);
              legend.vanished = !legend.vanished;
              e.stopPropagation();
          });

The toggling process is very complex and is based on many local attributes:
_toggle: function(shapes, index, isOff, dyn, seriesName, plotName){
            arrayUtil.forEach(shapes, function(shape, i){
                var startFill = dyn.fills[i],
                    endFill = this._getTransitionFill(plotName),
                    startStroke = dyn.strokes[i],
                    endStroke = this.transitionStroke;
                if(startFill){
                    if(endFill && (typeof startFill == "string" || startFill instanceof Color)){
                        fx.animateFill({
                            shape: shape,
                            color: {
                                start: isOff ? endFill : startFill,
                                end: isOff ? startFill : endFill
                            }
                        }).play();
                    }else{
                        shape.setFill(isOff ? startFill : endFill);
                    }
                }
                if(startStroke && !this.outline){
                    shape.setStroke(isOff ? startStroke : endStroke);
                }
            }, this);
        }

I tried also checking & unchecking the dijit/form/Checkbox in a legend manually, but that does not trigger the _toggle function in any case, even if you do a render() / fullrender() on the chart.
With that in mind it seems that there is no other possibilty to toggle the series on and off than by firing the onclick events manually.
To make your code less fragile, you could access the Checkbox widgets within the legend manually using:

query(".dijitCheckBox", legend); // Should deliver an array containing
  the widgets.

and triggering the onclick event on them. Their keynumber in the array should correspond to the order the series where added...
Dojo is a fine piece of work, please dont stop working with it !

A: I think i've got it !
I found another way to access the checkboxes ! It's the same way dojo uses internally to connect the "toggle code" to the onclick event. First take a look at this from SelectableLegend.js (Lines 150 - 156):

          //  toggle action
          var legendCheckBox = query(".dijitCheckBox", legend)[0];
          hub.connect(legendCheckBox, "onclick", this, function(e){
              this._toggle(shapes, i, legend.vanished, originalDyn, seriesName, plotName);
              legend.vanished = !legend.vanished;
              e.stopPropagation();
          });

It looks like they use the ".dijitCheckBox" class to find the checkbox dom element and connect to it using dojo/connect. Now based on that, i made this function:

function toggleSeries (legend,num) {
dojo.query("*",legend.legends[num])[0].click();
dijit.findWidgets(legend.legends[num])[0]._onClick();   }

It doesn't use any class definition (because of the *) and it accesses the areas where the checkboxes are from within the SelectableLegend. It needs the SelectableLegend and the number of the series you want to deactivate as parameters. Here the jsfiddle example with this function & hiding all 4 of your series with it:
http://jsfiddle.net/luciancd/92Dzv/17/
Also please notice the "onDomReady" Option in jsfiddle, without it: doesnt work in IE.
And the ready function within the code !
Lucian


text:
Q: Разница между invokevirtual & invokespecial? Правильно ли я поняла разницу между двумя инструкциями?

*

*invokevirtual применяется для вызова методов объекта и в качестве параметра в стек помещается ссылка на объект-владелец класса (aload i).

*invokespecial применяется для инициализации класса и вызова приватных методов. В случае вызова приватных методов всегда в стек записывается ссылка на объект-владелец (this) командой aload 0.

redpajama_set_name: RedPajamaStackExchange


text:
Q: Java speech API null response I am using the java speech recognition API  - Jarvis located at https://github.com/lkuza2/java-speech-api
However when I run my application, I get an error : Server returned HTTP response code: 400 for URL: https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=en-US&maxresults=1 (This is the URL that this api uses to get response from Google)
I also created a API key as mentioned in the earlier posts and tried to use the url (this is version 2 API): www.google.com/speech-api/v2/recognize?output=json&lang=en-US&key=MYKey". But in this case I get a null response from Google.
Can anybody please tell me how to get around this?

A: I change some things from the Recognizer class:
I change the GOOGLE_RECOGNIZER_URL constant to:
    private static final String GOOGLE_RECOGNIZER_URL = "https://www.google.com/speech-api/v2/recognize?output=json&lang=en-us&key=YOUR_KEY";

Then I changed this method because the response data have 2 lines
   private String rawRequest(File inputFile, int maxResults, int sampleRate) throws IOException

The first line (the one that is read and sent) is null (i don¡t really know why) and the second line has the response of the speech recognized. For this you must read the second line (don't know if there is a nicer way):
    String response = br.readLine();
    response = br.readLine();
    br.close();
    return response;

Then I change this method, I think it was using the v1 URL response or something because this method looks for utterance in the json response and there is none utterance key.
    private void parseResponse(String rawResponse, GoogleResponse googleResponse)
    if (rawResponse == null)
        return;

    JSONObject jsonObject = new JSONObject(rawResponse);
    JSONArray jsonArray= (JSONArray) jsonObject.get("result");
    JSONArray jsonArrayResult = (JSONArray) jsonArray.getJSONObject(0).get("alternative");
    googleResponse.setResponse(jsonArrayResult.getJSONObject(0).get("transcript").toString());
    googleResponse.setConfidence(jsonArrayResult.getJSONObject(0).get("confidence").toString());

I'm new with the json library so it might be a better and shorter way but this worked for me!


text:
Q: Pass Snapshot Data from One dart file to another in flutter project In my flutter project their are 2 dart files.
In the 1st dart page their is an initstate func that fetches snapshot data from firebase database[from line 19 onwards]. The first page is further routes to the second page[at line 71]. While routing it must also send the snapshot data to the 2nd dart page. In the second page the data is extracted from snapshot and used as initial value of the TextField in the 2nd dart page.
Here is the code of both the dart file.
1st dart file:
import 'package:firebase_auth/firebase_auth.dart';
import 'package:firebase_database/firebase_database.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:udharibook/Screens/UserProfile.dart';
import 'package:udharibook/services/authservice.dart';
import 'Customer_Support.dart';

class DashboardPage extends StatefulWidget {
  @override
  _DashboardPageState createState() => _DashboardPageState();
}

class _DashboardPageState extends State<DashboardPage> {

  String userName;
  @override
  void initState()
  {
    super.initState();
    FirebaseAuth _auth = FirebaseAuth.instance;
    DatabaseReference DBRef = FirebaseDatabase.instance.reference().child('Users');
    _auth.currentUser().then((curUser){
      DBRef.child(curUser.uid).once().then((DataSnapshot user){
        userName = user.value['Name'];
        setState(() {
          print('Username is:'+userName);
        });
      });
    });

  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('$userName'),
        backgroundColor: Color.fromRGBO(162, 42, 43, 1.0),
        actions: <Widget>[
          IconButton(
              icon: Icon(Icons.search),
              onPressed: () {
                print("Search Clicked");
              }),
          IconButton(
              icon: Icon(Icons.sort),
              onPressed: () {
                print("Sort Clicked");
              }),
        ],
      ),
      drawer: Drawer(
        child: ListView(
          children: <Widget>[
            DrawerHeader(
              child: Text('$userName'),
              decoration: BoxDecoration(
                color: Color.fromRGBO(162, 42, 43, 1.0),
              ),
            ),
            CustomMenu(
                Icons.person,
                'Profile',() => {

                      Navigator.pop(context),
                      Navigator.push(
                          context,
                          new MaterialPageRoute(
                              builder: (context) => UserProfile()))
                    }),
            CustomMenu(Icons.assessment, 'Reports', () => {}),
            CustomMenu(Icons.settings, 'Settings', () => {}),
            CustomMenu(
                Icons.perm_phone_msg,
                'Customer Support',
                () => {
                      Navigator.pop(context),
                      Navigator.push(
                          context,
                          new MaterialPageRoute(
                              builder: (context) => CustSupport()))
                    }),
            CustomMenu(Icons.lock, 'Log Out', () => {AuthService().signOut()}),
          ],
        ),
      ),
    );
  }
}

class CustomMenu extends StatelessWidget {
  IconData icon;
  String text;
  Function onTap;

  CustomMenu(this.icon, this.text, this.onTap);

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return Padding(
        padding: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
        child: Container(
            decoration: BoxDecoration(
                border:
                    Border(bottom: BorderSide(color: Colors.grey.shade400))),
            child: InkWell(
                splashColor: Colors.redAccent,
                onTap: onTap,
                child: Container(
                  height: 60.0,
                  child: Row(
                    mainAxisAlignment: MainAxisAlignment.spaceBetween,
                    children: <Widget>[
                      Row(
                        children: <Widget>[
                          Icon(icon),
                          Padding(
                              padding: const EdgeInsets.all(8.0),
                              child: Text(
                                text,
                                style: TextStyle(
                                    fontSize: 17.0, fontFamily: 'Exo2'),
                              )),
                        ],
                      ),
                      Icon(Icons.arrow_right),
                    ],
                  ),
                ))));
  }
}

2nd Dart file:
import 'dart:io';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:image_picker/image_picker.dart';
import 'package:firebase_storage/firebase_storage.dart';
import 'package:path/path.dart';

class UserProfile extends StatefulWidget {
  @override
  _UserProfileState createState() => _UserProfileState();
}
class _UserProfileState extends State<UserProfile> {
  File _image;
  TextEditingController nameController = TextEditingController(text: 'abc');
  TextEditingController mobileController = TextEditingController(text: '88888888');
  TextEditingController emailController =TextEditingController()..text='abc@gmail.com';
  TextEditingController addressController =TextEditingController()..text='India';

  @override
  Widget build(BuildContext context) {

    Future getImage() async{
      var image=await ImagePicker.pickImage(source: ImageSource.gallery);

      setState(() {
        _image=image;
        print('Image Path $_image');
      });
    }

    Future uploadPic(BuildContext context) async{

      String fileName = basename(_image.path);
      StorageReference firebaseStorageRef = FirebaseStorage.instance.ref().child(fileName);
      StorageUploadTask uploadTask = firebaseStorageRef.putFile(_image);
      StorageTaskSnapshot taskSnapshot = await uploadTask.onComplete;
      setState(() {
        print("Profile Picture Uploaded");
        Scaffold.of(context).showSnackBar(SnackBar(content:Text('Profile Updated')));
      });
    }
    return Scaffold(
      resizeToAvoidBottomPadding: false,
      appBar: AppBar(
        title: Text('User Profile'),
        backgroundColor: Color.fromRGBO(162, 42, 43, 1.0),
      ),
      body: Builder(
        builder: (context) => Container(
          child: Column(
            children: <Widget>[
              SizedBox(
                height: 20.0,
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: <Widget>[
                  Align(
                    alignment: Alignment.center,
                    child: CircleAvatar(
                      radius: 70,
                      backgroundColor: Colors.white,
                      child: ClipOval(
                        child: SizedBox(
                            height: 120.0,
                            width:120.0,
                            child:_image!=null?Image.file(_image,fit: BoxFit.fill):
                            Image.network(
                              'https://firebasestorage.googleapis.com/v0/b/udhari-book.appspot.com/o/DefaultImage.png?alt=media&token=06bddd3e-7f11-476b-a982-dfb21096f9c7',
                              fit: BoxFit.fitWidth,
                            ),
                        ),
                      ),
                    ),
                  ),
                  Padding(
                    padding: EdgeInsets.only( ),
                    child: IconButton(
                        icon: Icon(Icons.camera_alt), onPressed: () {
                          getImage();
                    }),
                  )
                ],
              ),
              Padding(
                  padding: EdgeInsets.only(top:20.0,left: 10.0,right: 10.0),
                  child:SizedBox(
                    height: 40.0,
                  child: TextField(
                    controller: nameController,
                    decoration: InputDecoration(
                        labelText: 'Full Name',
                        labelStyle:
                            TextStyle(fontFamily: 'Exo2', color: Colors.grey),
                        border: OutlineInputBorder(
                            borderRadius: BorderRadius.circular(5.0)
                        ),
                        focusedBorder: OutlineInputBorder(
                            borderRadius: BorderRadius.circular(5.0),
                            borderSide: BorderSide(
                                color:
                                Color.fromRGBO(162, 42, 43, 1.0)
                            )

                        )
                    ),
                  ),
              )),
              Padding(
                padding: EdgeInsets.only(top:15.0,left: 10.0,right: 10.0),
                child:SizedBox(
                  height: 40.0,
                child: TextField(
                  controller: mobileController,
                  enabled: false,
                  keyboardType:TextInputType.phone,
                  decoration: InputDecoration(
                      labelText: 'Mobile Number',
                      labelStyle:
                      TextStyle(fontFamily: 'Exo2', color: Colors.grey),
                      border: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(5.0)),
                      focusedBorder: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(5.0),
                          borderSide: BorderSide(
                              color:
                              Color.fromRGBO(162, 42, 43, 1.0)
                          )
                      )
                  ),
                ),
              )),
              Padding(
                padding: EdgeInsets.only(top:15.0,left: 10.0,right: 10.0),
                child:SizedBox(
                  height: 40.0,
                child: TextField(
                  controller: emailController,
                  keyboardType: TextInputType.emailAddress,
                  decoration: InputDecoration(
                      labelText: 'Email (Optional)',
                      labelStyle:
                      TextStyle(fontFamily: 'Exo2', color: Colors.grey),
                      border: OutlineInputBorder(
                        borderRadius: BorderRadius.circular(5.0)
                      ),
                      focusedBorder: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(5.0),
                          borderSide: BorderSide(
                              color:
                              Color.fromRGBO(162, 42, 43, 1.0)
                          )

                      )
                  ),
                ),
              )),
              Padding(
                padding: EdgeInsets.only(top:15.0,left: 10.0,right: 10.0,bottom: 30.0),
                child: TextField(
                  maxLines: 3,
                  maxLengthEnforced: true,
                  controller: addressController,
                  keyboardType: TextInputType.emailAddress,
                  decoration: InputDecoration(
                      labelText: 'Address (Optional)',
                      labelStyle:
                      TextStyle(fontFamily: 'Exo2', color: Colors.grey),
                      border: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(5.0)
                      ),
                      focusedBorder: OutlineInputBorder(
                          borderRadius: BorderRadius.circular(5.0),
                          borderSide: BorderSide(
                              color:
                              Color.fromRGBO(162, 42, 43, 1.0)
                          )
                      )
                  ),
                ),
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceEvenly,
                children: <Widget>[
                  SizedBox(
                    width:130.0,
                  height: 50.0,
                  child:RaisedButton(
                    color: Color.fromRGBO(162, 42, 43, 1.0),
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(18.0)
                    ),
                    onPressed: (){
                      uploadPic(context);
                      //readUSerData();
                      Navigator.of(context).pop();
                    },
                    elevation: 4.0,
                    splashColor: Colors.blueGrey,
                    child: Text(
                      'Save',
                      style: TextStyle(
                        color:Colors.white,fontSize: 22.0,fontFamily: 'Exo2'
                      ),
                    ),
                  )),
                  SizedBox(
                    width:130.0,
                  height:50.0,
                  child:RaisedButton(
                    color: Color.fromRGBO(162, 42, 43, 1.0),
                    shape: RoundedRectangleBorder(
                        borderRadius: BorderRadius.circular(18.0)
                    ),
                    onPressed: (){
                      Navigator.of(context).pop();
                    },
                    elevation: 4.0,
                    splashColor: Colors.blueGrey,
                    child: Text(
                      'Cancel',
                      style: TextStyle(
                          color:Colors.white,fontSize: 22.0,fontFamily: 'Exo2'
                      ),
                    ),
                  ))
                ],
              )
            ],
          ),
        ),
      ),
    );
  }
}

A: You can create a constructor for your second page that takes in the data you need. You then pass that data into the page when you call the Navigator e.g.
class UserProfile extends StatefulWidget {

  final String username;

  const UserProfile({Key key, this.username}) : super(key: key);

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

Then in your first page when navigating you call:
Navigator.push(context, MaterialPageRoute(builder:
    (context) => UserProfile(username: userName)))


text:
Q: pytorch ctc_loss why return tensor(inf, grad_fn=)
torch.version : 1.10.1
os: windows 10

import torch
import torch.nn as nn

ctc_loss = nn.CTCLoss()
probs = torch.tensor([
    [
        [1.0, 2, 3, 4, 5],
        [3.0, 4, 5, 6, 0],
    ],
])
probs_size = torch.tensor([1, 1])

targets = torch.tensor([
    [1.0, 2, 3, 4, 5],
    [3.0, 4, 5, 6, 0],
])
target_lengths = torch.tensor([5, 4])

probs = probs.log_softmax(1).requires_grad_()
loss = ctc_loss(probs, targets, probs_size, target_lengths)
print(f"{loss=}")

loss=tensor(inf, grad_fn=MeanBackward0)

Hello everyone,
I tried to write a small demo of ctc_loss,
My probs prediction data is exactly the same as the targets label data.
In theory, loss == 0
But why the return value of pytorch ctc_loss will be inf (infinite) ??
What is the correct way to use it?


text:
Q: Python 3: object() takes no parameter I have a class inside a file called Weapons.py called Pistol that looks like this:
class Pistol(object):
    MAXAMMO = 6
    def __init__(self, ammo):
        if(ammo <= self.MAXAMMO):
            self.ammo = ammo
    def shoot(self):
        if(ammo > 0):
            accuracy = random.randint(0, 3)
            return 3 * accuracy
            ammo -= 1
        else:
            print("No ammo")

And a class called ColtM1911 that inherits from Pistol.  It looks like this:
class ColtM1911(Pistol):
    MAXAMMO = 7
    def __init__(self, ammo):
        self.ammo = 7

When I run:
import Player
import SetUp
from Utils import *
import pickle
import TitleAnimation
import os
import SaveLoad
from Weapons import *

gun = ColtM1911(5)

In another file it gives me "TypeError: object() takes no parameters"  When trying this in the shell it worked, so I suspect it is to do with having it in a separate file.
The full traceback is,
Traceback (most recent call last):
  File "C:\Users\James\Documents\game.py", line 3, in <module>
    gun = Weapons.ColtM1911(5)
TypeError: object() takes no parameters

A: The only way I can recreate your error is if Pistol is actually defined as:
class Pistol(object()):
                 # ^ note extraneous parentheses

In Python 3.x, you don't need object at all; all classes are new-style by default. Also, there are logic errors and M1911.__init__ is redundant. Try something like:
import random

class Pistol:

    MAXAMMO = 6

    def __init__(self, ammo):
        if ammo <= self.MAXAMMO:
            self.ammo = ammo
        else:
            # what do you want do do here? Raise an error? Set ammo = MAXAMMO?

    def shoot(self):
        if self.ammo > 0:
            self.ammo -= 1
            return 3 * random.randint(0, 3)
        else:
            print("No ammo")

class ColtM1911(Pistol):

    MAXAMMO = 7


text:
Q: If the JWT token for auth is saved in the HTTP-Only cookie, how do you read it from the cookie so that I can include it in request header? I am building a Node web app using JWT for user auth.
My server sends JWT in HTTP-Only cookie via 'Set-Cookie' when user submits correct id and password, but I am stuck on how to access that JWT stored within the cookie so that I can include it in the Authorization header when making authorized API requests.
How can I access the HTTP-Only cookie from client-side to include it when sending API request to server?
Or, would it be safe to just not use the cookie at all by having the server send the JWT in response body?  So that I use the JWT by putting it in a client-side variable?  That way, I believe the variable is only alive until the user closes the browser.
I have looked for many resources, but was not able to find clear answer to this issue that I am stuck with.

A: While there are numerous ways to solve this problem, I will suggest the method where the client sends the JWT twice on each request: in an HttpOnly cookie, and also an an Authentication: header.

Let's examine what security issue each is solving:
HttpOnly Cookie
From the Mozilla documentation:

To help mitigate cross-site scripting (XSS) attacks, HttpOnly cookies are inaccessible to JavaScript's Document.cookie API; they are only sent to the server.

This is to mitigate cross-site scripting risk; imagine your website has an XSS vuln -- for example I can put <script>some_code{..}</script> into a comment, and any user who views my comment will have my code running in their browser. Yes, the attacker's code is running inside the victim's logged-in browser, but because of the HttpOnly flag, it can't extract the session cookie and send it to the attacker.
Authentication header
The problem with cookie authentication is that the browser will automatically attach them to any request to the domain that the cookie belongs to, this allows cross-site request forgery attacks. To prevent this, the usual method is to send the session token (in your case a JWT) to the client in a method other than a cookie, ie in a different header, or maybe in a hidden HTML field.
If the client is able to echo the JWT token back to you on their next request, that means they were able to read the previous response, and are not an attacker doing a blind injection CSRF attack.

Overall Suggestion
Combine the two!
The two methods serve different purposes: HttpOnly cookies protect against XSS attacks while Authentication headers protect against CSRF attacks.
There are many ways to combine them, but they all boil down to putting the JWT in some sort of authentication header, and putting a sessionID in the cookie, and having the server check that these belong to the same session. Important: remember that an attacker who achieves XSS on your site will be able to read the JWT, so for the cookie to be doing its job, the cookie should be a separate value that is not contained in the JWT. (ie if the attacker can figure out the right cookie value by looking at the JWT, then the cookie is not providing any security).


text:
Q: WKHTTPCookieStore.setCookie completion handler not called I need to share cookies between WKWebView instances - for this i'm using a single WKWebViewConfiguration instance which is then used to init every WKWebView.
In order to do this I assume I have to use a shared WKProcessPool, ex:
let websiteDataStore = WKWebsiteDataStore.default()
websiteDataStore.httpCookieStore.add(self)

let configuration = WKWebViewConfiguration()
configuration.websiteDataStore = websiteDataStore
configuration.processPool = WKProcessPool()   /* !!! */

However doing so causes the setCookie completion handler to NOT fire.
let cookieStore = self.webConfiguration.websiteDataStore.httpCookieStore
     cookieStore.setCookie(cookie, completionHandler: {
})

If i do not set the WKProcessPool (*) instance - then completion block fires fine, but obviously WebViews do not see the cookies ; /  Did anyone encounter this? Ideas on how else to share the cookies?
iOS: 11.2.6

A: After further testing I've managed to find solution - although i'm not sure what is happening. In short - above completion handler fires OK after WKWebView is instantiated.
In my case I need to set some cookies after login (so no webviews are displayed ATM). So calling setCookie only queues these operations somewhere - they are flushed when web client is fired. If someone can link documentation - that's be great!

UPDATE
So as this issue is still present - I've finally got back to this. My solution for now is to:

*

*Cache cookie value in keychain (every time app calls HTTPCookieStore.setCookie   - which may complete or not (which is the problem)

*When HTTPCookieStore.setCookie{ }  completion block fires (confirmation that cookie was indeed set) i then remove the value from keychain and webview is now responsible for lifecycle of the cookie value)

*On every start of app i check if cookie values are cached in keychain -> if so HTTPCookieStore.setCookie()
Above can loop infinitely UNTIL webview is actually opened.

A: My problem was with deleting cookies to log a user out of the application. The completion handler for getAllCookies() was not firing, so what is working for me is forcing the webView to reload which will flush the queue and delete the cookies.
webView.configuration.websiteDataStore.httpCookieStore.getAllCookies { cookies in
    for cookie in cookies {
        if cookie.name == "authentication" {
            self.webView.configuration.websiteDataStore.httpCookieStore.delete(cookie)
        }
    }
}
webView.reload()


text:
Q: OpenCL/OpenGL Interop on OSX -- has anyone ever shared a Renderbuffer or Texture? Problem: Attempting to share a Renderbuffer (or a Texture), bound to a Framebuffer, fails when clSetKernelArg() is called.  Thorough error checking reports no problems until that call.
My program generates frames for a video projector that runs at 60fps (16.7ms frames).
My kernel runs in (typically) 24ms, but it's taking 50ms between each frame. I assume that some of the extra cost is because I'm using the GPU to calculate the pixels, then enqueuing a readbuffer to pull the data off the GPU, then using glDrawPixels to put it back onto the GPU for display. Perfect situation to try OpenGL/OpenCL interoperation, right?, to avoid the two extra copy operations.
There are many examples, and I have succeeded in sharing a VBO with OpenCL, and can write to it, but that doesn't help me. I don't want to write vertex data, just a 2-D image that's been calculated.
There are examples of two different ways to do this, and they both involve Framebuffer objects.
You can attach a Renderbuffer to a Framebuffer, or you can attach a Texture to a Framebuffer.
Then you should be able to write to that buffer in opencl and display it with opengl, no extra copies.
I have found a few examples of this in code, and I think I'm doing everything exactly the way the examples say to do it, but maybe it is broken in OSX? .. because it doesn't work. The FBO is "Complete", no errors along the way, until I try to do the clSetKernelArg. That call returns error -38, CL_INVALID_MEM_OBJECT.
*note: I would rather use a Renderbuffer than a Texture, since all I'm doing is making a 2-D RGB image that I want to display. But I tried a Texture out of desperation. Still no help.
I do these steps, in this order, with some other stuff in between:
kCGLContext = CGLGetCurrentContext();
kCGLShareGroup = CGLGetShareGroup( kCGLContext );

glGenFramebuffers( 1, &fboid );
glBindFramebuffer( GL_FRAMEBUFFER, fboid );

glGenRenderbuffers( 1, &rboid );
glBindRenderbuffer( GL_RENDERBUFFER, rboid );
glRenderbufferStorage( GL_RENDERBUFFER, GL_RGBA, rb_wid, rb_hgt );

glboid = rboid;

glFramebufferRenderbuffer( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rboid );

then:
cl_context_properties ourprops[] = { CL_CONTEXT_PROPERTY_USE_CGL_SHAREGROUP_APPLE, (cl_context_properties)kCGLShareGroup, 0 };

contextZ = clCreateContext( ourprops, 1, &dev_idZ[0], clLogMessagesToStdoutAPPLE, NULL, &err );

clbo = clCreateFromGLRenderbuffer( contextZ, CL_MEM_WRITE_ONLY, glboid, &err );

then clCreateCommandQueue, clCreateProgramWithBinary, clBuildProgram, clCreateKernel, all no errors
then later:
glFinish();
clEnqueueAcquireGLObjects( queueZ, 1, &clbo, 0,0,0 );

err = clSetKernelArg( kernelZ, 1, sizeof(cl_mem), &clbo );

... which fails with error -38, CL_INVALID_MEM_OBJECT.
clbo is a static cl_mem, just like the buffer object that's used when interop is not on. The difference being that it was created using clCreateFromGLRenderbuffer instead of clCreateBuffer, and it's in a context created in association with the gl sharegroup.

(I've tried adding a second Renderbuffer and attaching it to a Depth Attachment Point, in case that was needed. No help.)
(I've tried the same thing with a Texture bound to the FBO, and I get the same error in the same place.)
... does anybody have any ideas at all?

A: Ok; got it!
The problem was that the kernel was specifying a uint * as its output argument instead of image2d_t.  I didn't think this would matter at least for the setkarg call; they are both cl_mem on the host side (image2d_t is #defined as cl_mem).  However, once you call clCreateFromGLTexture2D or clCreateFromGLRenderbuffer, that object acquires properties the ocl knows about.  When the kernel was changed to specify image2d_t, more useful error messages appeared, and it now works.
Bonus fact: you can't write to a UNORM_INT8 image with write_imageui; you have to use write_imagef.


text:
Q: Performance Testing for Native Mobile Applications I have to do a POC on Performance Testing for a Native Mobile Application. Need some help on how to go ahead. Many tools in the market work on a browser based on the Mobile. What if, I have developed an app (eg: like Facebook app on Android phone) and want to test load/Volume/Stress. A heads up would be that we have developed an .apk file and installed it on the mobile device. The App is up.

A: UI Test/Performance/Stress (app crawlers / monkey testing)

*

*Android Monkey http://developer.android.com/tools/help/monkey.html

*Monkop http://monkop.com/

*Others: AppThwack, Testdroid, GameBench

Load/Volume (api oriented)

*

*Blazemeter

*Apica


text:
Q: Unable to load URL in Hybrid Webview Xamarin forms https://spo.mcd.com/sites/seeit_development3/brand/cognizant-test-brand-05242017 this is the URL that i try to open in HybridWebView.
I get a 401 Unauthorized Error.
But The same URL opens in SFSafariViewController.
Have set the Following permissions in my info.plist:

NSAppTransportSecurity : Dictionary {
    NSAllowsArbitraryLoads : Boolean
    NSAllowsArbitraryLoadsForMedia : Boolean
    NSAllowsArbitraryLoadsInWebContent : Boolean
    NSAllowsLocalNetworking : Boolean
    NSExceptionDomains : Dictionary {
        spo.mcd.com : Dictionary {
            NSIncludesSubdomains : Boolean
            NSExceptionAllowsInsecureHTTPLoads : Boolean
            NSExceptionMinimumTLSVersion : String
            NSExceptionRequiresForwardSecrecy : Boolean   // Default value is YES
            NSRequiresCertificateTransparency : Boolean
        }
    }
}


text:
Q: Upgrading SQL Server (2014) Express to Standard I have a server running SQL Server 2014 Express Edition that is fast approaching the 10GB limit for a database.
I've now purchased SQL Server 2014 Standard and wish to use it. SQL Server is no longer available by boxed copy, so, I purchased it on Open with the relevant CALs.
When I go to VLSC, I am only given the option to download the ISO files to perform a fresh install - I have done this countless times on fresh installs without issue.
However, when you go in to the setup for Express, you do have the option to change versions if you have a serial key:

I have tried contacting Microsoft without any luck what so ever.
I was wondering if anyone can help as I would obviously prefer to input a small key and change the license rather than having to reinstall over the top.

A: In the \x64 folder there is a file called DefaultSetup.ini where the PID will be. Once you copy the PID from there, run the setup and choose edition upgrade as you've already shown and input the PID copied from the file.


text:
Q: How to retrieve data if you forget the BitLocker key disk? In Windows 10, the system partition is encrypted with BitLocker, and the system prompts that you need to insert the key disk to decrypt it.
At present, the key disk and the set key have been lost. And you have logged in to your Windows account, and you are prompted that your key has not been backed up.
In this case, how can we retrieve the data?

A: It is not impossible to recover the data, but it is beyond the capability and resources of most people.
To recover the data you MUST recover key, and if you have lost the key itself, you will need powerful computers and lots of time to attempt to recreate the key. Like, super computers, and even then it'll take lengths of time best measured in lots of years, to recreate the key. Clarification: by lots of years, I mean more years than you have to live, even if you were just born yesterday, AND taking into account likely medical advances.
For the average person, working with the average data, this is just out of the question. This is why there were multiple strong warnings when you applied Bitlocker to the drive about copying and backing up the key.


text:
Q: what does the token ! mean in this context (alongside a binding)? I guess this mean no something but I'm not sure and besides I don't get what does it mean in the loop context
This a function looping through an array of objects.
function journalEvents(journal) {
let events = [];
   for (let entry of journal) {
     for (let event of entry.events) {
       if (!events.includes(event)) {
         events.push(event);
       }
} }
   return events;
 }

I outputs 4 numbers, getting a pattern in the data

A: includes is a boolean function: it return true weather the element event does exist in events list. The ! operator juust reverse the returning value (i.e. you get false if it returns true, and true otherwise).

A: This is a logical "not" operator.
It basically means "take the opposite of this boolean". When the boolean after it is true, it returns false, and vise versa.
In your context, the if statement there means "if event isn't in events". This prevents the code from adding the same event to the "events" array twice.
You can read more on logical operators here!


text:
Q: can't install lxml (python 2.6.3, osx 10.6 snow leopard) I try to:

easy_install lxml

and I get this error:

File "build/bdist.macosx-10.3-fat/egg/setuptools/command/build_ext.py", line 85, in get_ext_filename
  KeyError: 'etree'

any hints?

A: Due to incompatible changes in the 2.6.3 version of python's distutils, the old easy_install from setuptools no longer works.  You need to replace it with easy_install from Distribute.  Follow the instructions there, basically:
$ curl -O http://nightly.ziade.org/distribute_setup.py
$ python distribute_setup.py

assuming the 2.6.3 python is first on your $PATH.
EDIT: Besides the option to migrate from setuptools to Distribute, Python 2.6.4, which should be released in a couple of weeks, will contain a workaround in distutils that will unbreak setuptools.  Thanks, Tarek, for the fix and thanks, jbastos, for bringing this issue up.
FURTHER EDIT: setuptools itself has been updated (as of 0.6c10) to work around the problem with 2.6.3.

A: Ned :

incompatible changes in the 2.6.3 version of python's distutil

Not precisely. The API hasn't changed but Setuptools overrides them, and makes the assumption they are called in a particular order.
Lennart:

The Distribute installation doesn't seem to trigger the bug

Yes indeed, this precise bug was detected some time ago and fixed in Distribute (and in Ubuntu's setuptools package)


text:
Q: Why my Widget can not find my Class which my App could see and find it in SwiftUI? I am trying to feed my Widget the information from my class, but for unknown reason for me, the Widget is not able to see and find the Class! here is my class:
import SwiftUI

class AppColor: ObservableObject {

    static let shared: AppColor = AppColor()
    @Published var color: Color = Color.red

}

here is my ContentView:
import SwiftUI

struct ContentView: View {

    @StateObject var appColor: AppColor = AppColor.shared

    var body: some View {

        ZStack {

            appColor.color.ignoresSafeArea()

            Button(action: {

                if appColor.color == Color.red {

                    appColor.color = Color.yellow

                }
                else {

                    appColor.color = Color.red

                }

            }) {
                Text("change Color")
                    .foregroundColor(Color.black)
                    .bold()
            }

        }

    }
}

and here is my Widget:
struct testWidgetEntryView : View {
    var entry: Provider.Entry

    @StateObject var appColor: AppColor = AppColor.shared

    var body: some View {

        appColor.color

    }
}

and here is my file positions in app:

A: Even though the files may be in the same project, they can belong to different targets.
When you create a widget extension, you also create a new target. If you want to use a specific file in some target, you need to add it to this target.
You can change this from the right side panel: File Inspector -> Target Membership.
Make sure to check the widget target option for the files you want to use in the widget.

Also note that the app and its extensions are different processes. This means that if you change the appColor in the main app, it won't change in the widget.
You check this post for more information:

*

*Share data between main App and Widget in SwiftUI for iOS 14


text:
Q: Union all with loop in oracle select statement I'm working in an oracle DB that has 20 tables with the same structure but divided by years. So, it started in ft_expenses_2002 and goes until ft_expenses_2021 (the year when I'm writing this). I need to put all these tables' columns together before doing some maths and my first approach was to use UNIAN ALL statements. It worked but I'm wondering if it's possible to do something more elegant, like using a FOR LOOP. It would not only make the query far more elegant but would avoid future maintenances because every year a new table with the "_new_year" suffix will be created.

A: Create a view for all the tables:
CREATE VIEW ft_expenses AS
          SELECT * FROM ft_expenses_2002
UNION ALL SELECT * FROM ft_expenses_2003
UNION ALL SELECT * FROM ft_expenses_2004
UNION ALL SELECT * FROM ft_expenses_2005
UNION ALL SELECT * FROM ft_expenses_2006
UNION ALL SELECT * FROM ft_expenses_2007
UNION ALL SELECT * FROM ft_expenses_2008
UNION ALL SELECT * FROM ft_expenses_2009
UNION ALL SELECT * FROM ft_expenses_2010
UNION ALL SELECT * FROM ft_expenses_2011
-- ...
UNION ALL SELECT * FROM ft_expenses_2021

Then just do your query using the view.
Next year when you add a 2022 table then recreate the view with the extra table added to the view.

Alternatively, create a table from the originals so that everything is in one table that you can query directly:
CREATE TABLE ft_expenses (year, col1, col2, col3) AS
          SELECT 2002, col1, col2, col3 FROM ft_expenses_2002
UNION ALL SELECT 2003, col1, col2, col3 FROM ft_expenses_2003
UNION ALL SELECT 2004, col1, col2, col3 FROM ft_expenses_2004
UNION ALL SELECT 2005, col1, col2, col3 FROM ft_expenses_2005
UNION ALL SELECT 2006, col1, col2, col3 FROM ft_expenses_2006
UNION ALL SELECT 2007, col1, col2, col3 FROM ft_expenses_2007
UNION ALL SELECT 2008, col1, col2, col3 FROM ft_expenses_2008
-- ...
UNION ALL SELECT 2021, col1, col2, col3 FROM ft_expenses_2021

Then drop the individual tables (make sure you backed everything up first) and create views if you still need to access then by the original names:
CREATE VIEW ft_expenses_2002 (col1, col2, col3) AS
SELECT col1, col2, col3 FROM ft_expenses WHERE year = 2002;

CREATE VIEW ft_expenses_2003 (col1, col2, col3) AS
SELECT col1, col2, col3 FROM ft_expenses WHERE year = 2003;

-- ...

CREATE VIEW ft_expenses_2021 (col1, col2, col3) AS
SELECT col1, col2, col3 FROM ft_expenses WHERE year = 2021;

A: I've found here a really good and short way to solve my problem, it was:
SELECT
  GROUP_CONCAT(
    CONCAT(
      'SELECT * FROM `',
      TABLE_NAME,
      '`') SEPARATOR ' UNION ALL ')
FROM
  `INFORMATION_SCHEMA`.`TABLES`
WHERE
  `TABLE_NAME` LIKE 'ft_expenses_%'
INTO @sql;
PREPARE stmt FROM @sql;
EXECUTE stmt;

A: Depends on your definition of "elegant".
It's certainly possible to use dynamic SQL to look for every table whose name fits a particular pattern.  My guess is that the simplest thing to do would be to create a view that does the union all, write your processing code against that view, and then have a bit of dynamic SQL that can rebuild the view based on what tables exist.  You could then run that procedure when new tables are created (if you can hook in to that process) or based on a DDL trigger or just schedule it to run in the early morning hours every year/ month/ day depending on how likely it is that a new table is going to suddenly show up.
create or replace procedure build_view
as
  l_sql_stmt varchar2(32000);
  type typ_table_names is table of varchar2(256);
  l_tables typ_table_names;
begin
  l_sql_stmt := 'create or replace view my_view as ';

  select table_name
    bulk collect into l_tables
    from user_tables
   where table_name like 'ft_expenses%';

  for i in 1 .. l_tables.count
  loop
    l_sql_stmt := l_sql_stmt ||
                    ' select * from ' || l_tables(i);
    if( i != 1_tables.count )
    then
      l_sql_stmt := l_sql_stmt ||
                      ' union all ';
    end if;
  end loop;

  dbms_output.put_line( l_sql_stmt );
  execute immediate l_sql_stmt;
end;

A: You physical setup of the tables is state of the art of Oracle 6 (late 1980's).
You have two possibilities to upgrade. Either the DIY union all view as proposed in other answers, or simple follow the development the Oracle implemented since the above mentioned version.
Note, I'd not recommend to follow the advise to put all data in one table - why? You'd see no difference in the queries covering all data, but you'll spot a significant decrease in performance in queries on one or few years.
What was done in Oracle on this topic since the release 6?
In Oracle 7 (1990's) a partitioned views was introduced - which is similar idea to the proposal of the UNION ALL view.
Starting with Oracle 8 partitioning concept was introduced any improved in each following release.
So if you want to leverage the current Oracle features the partitioning should be applied:

*

*managing the data in acceptable size

*providing a flexibility in the access

Here an example how could you migrate in Oracle 19c
I assume that you table contains a column trans_dt containing a DATE with a year same as the tables year.
Start with the oldest table and change it to a partitioned table
alter table ft_expenses_2002 modify
  partition by range(trans_dt) interval(NUMTOYMINTERVAL(1,'YEAR'))
  ( partition p_init values less than (DATE'2002-01-01')
  ) online

Rename the table eliminating the year
rename ft_expenses_2002 to ft_expenses;

Now the table in partitioned and contains two partitions, the initial one and the partition for the 2002 year.
select PARTITION_NAME from user_tab_partitions where table_name = 'FT_EXPENSES' order by PARTITION_POSITION;

PARTITION_NAME
----------------
P_INIT
SYS_P2340

For each following years perform the below steps
Add a new partition
alter table ft_expenses
  exchange partition for( DATE'2003-01-01' ) with table ft_expenses_2003

Note that you use the for syntax to address the partition, so there is no need to know the partition name.
Additionally the recent version can create the partition in the exchange statement, so there is no need to lock table anymore.
Final Notes
You may include indexes in the reorganization.
As always backup all tables before  start.
Test carefully to check possible limitations.


text:
Q: Debugging Angular Bindings I am just starting with angular.js version 2 .
(Still using jQuery after all these years :-) )
There is still alot to learn.
One particular thing that bothers me: How do I debug binding problems in the DOM.
For example if I bind a click event and make a mistake:
If instead of:
<... (click)="onClick()" ...>

I write:
<... (click)="ThisFunctionCallIsMissspelledAndIsMissingParantheses" ...>

I find that the browser is completely happy to swallow up this syntax error and just ignore the click without printing out any error.
Also, assuming I am not the one that made this mistake (many times I need to debug other peoples' code) I cannot find this binding in the DOM. When I "Inspect Element" in the browser, all that's left in the tag are: "ngcontent_c0" hashes. (The original binding is gone).
So my questions are:

*

*Can I get the browser to spit out an error such as: ThisFunctionCallIsMissspelledAndIsMissingParantheses is undefined

*If I am debugging someone else's code, is there some way I can use the browser to get a hint of what is wrong? Can I somehow see in the DOM that ThisFunctionCallIsMissspelledAndIsMissingParantheses  is bound to said button? I am working with "ng serve" in debug mode: So I can see the .ts files. However the angular HTML bindings seem to be hashed.


text:
Q: Convert MS Access Color to hex with php? i have a MS Access Color like "16777215". This is the color white (#ffffff). How can i convert this color string to hex like #ffffff with php?
greetings!

A: There is a complete function which converts MS Access color values to RGB HEX. Thanks to WojtekT and poldixd for a few tips to solve this.
<?php
function color_msaccess2hex($in) {
    $hex = str_pad(dechex($in), 6, 0, STR_PAD_LEFT);

    // Switch first and third byte
    $hex = mb_substr($hex,4,2).mb_substr($hex,2,2).mb_substr($hex,0,2);

    return '#'.$hex;
}

A: Color values in MS Access are not stored in RGB mode but something like BGR.
That means that after converting the value to hex You need to switch places of first and third byte. Example:
Access color code: 5275647, converted to hex is: 507FFF, after switching first and third byte you get: FF7F50, and that's your html color code.
Here is a conversion table so you see what i mean:
http://cloford.com/resources/colours/500col.htm


text:
Q: How to rotate a Vector2?
I'm trying to rotate a Vector2 but nothing work.
I've tried the following -> didn't work:
x' = cos(angle)*x - sin(angle)*y & y' = sin(angle)*x + cos(angle)*y

I've tried using a rotation matrix -> didn't work
What am I doing wrong ? :/
angle = MathHelper.Pi;
direction.X = (int)((direction.X) * Math.Cos(angle) - direction.Y * Math.Sin(angle));
direction.Y = (int)((direction.X) * Math.Sin(angle) + direction.Y * Math.Cos(angle));

float angle = MathHelper.PiOver2;
Vector2 dir = new Vector2(direction.X, direction.Y);
Vector2.Transform(dir, Matrix.CreateRotationX(angle));
direction = new Point((int)dir.X, (int)dir.Y);

A: Vector2.Transform() returns a result rather than applying the changes in-place.
var transformed = Vector2.Transform(dir, Matrix.CreateRotationX(angle));
direction = new Point((int) dir.X, (int) dir.Y);

A: The first method you have written should work, as it's showed here also: http://www.oocities.org/davidvwilliamson/rotpoint.jpg
Remember to store the original values, and use those to determine the new values, and do not use the new x value to calculate y. Or store the products in separate variables.


text:
Q: Android SafeArgs - Can't import the Navigation Directions class generated I'm here to report my problem for what it seems I can't find any solution on the internet, so I decided to write here, I've been trying for days to solve this and I still don't understand where the reason for the error is. The error basically is, I can't import the class that is generated in navigations, Directions, when I write the whole path or when I click import, it just puts the whole path where the class is located and doesn't know what that is but behind it recognizes that there is a class there but can't give import to it. Strange isn't it? I appreciate any kind of solution you can give me, thanks!
package pt.saphirex.sample.android.ui

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import pt.saphirex.sample.shared.Greeting
import android.widget.TextView
import pt.saphirex.sample.android.R

fun greet(): String {
    return Greeting().greeting()
}

class MainActivity : AppCompatActivity() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        val tv: TextView = findViewById(R.id.text_view)
        tv.text = greet()

        pt.saphirex.sample.android.ui.user.home.UserHomeFragmentDirections // <---- Doesn't recognize
    }

}

My software versions are:

*

*Android Studio: 4.2.1

*KMM Plugin: 0.2.5(202-1.5.10-834-IJ)-3

GitHub example: https://github.com/0rangeFox/KMM-Sample

A: The solution is basically this, go to android's "build.gradle.kts", and add the following lines inside the "android { }" code:
android {
    ...

    sourceSets {
        getByName("main") {
            java.srcDir("build/generated/source/navigation-args")
        }
    }

    ...
}


text:
Q: React native + IOS As a beginner in react native framework.  I was able to build a small app and installed on my ios physical device via xcode. But this app doesn't work when I'm away from my laptop.
Is there any way I can always run this app on my device 7/24 even when I'm away from the network and my laptop (Without publishing in app store)?
Personal app and i need it on my device only.
Thank you,

A: Click on project then on menus open "product" > schema >edit schema then change build configuration "debug" to release.

Now run your project. It will run even after you are away from laptop.


text:
Q: C# query in Linq I'm using C# in Visual Studio 2015.
I have a List<MagicItem> magicItemList and I'm trying to do a simple query using Linq to fetch an Object that matches the Id that the user inputs.
This is my code:
int itemId = Convert.ToInt32(Console.ReadLine());

var query = from MagicItem magicItem in magicItemList
                where magicItem.Id == itemId
                select magicItem;

The thing that confuses me is that query's type is System.Collections.Generic.IEnumerable, so I can't fetch any of its attributes as a normal Object.
Is there a way to cast it so I can use it as a normal Object? Thanks in advance.
This is my MagicItem Class:
class MagicItem
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public int StockLevel { get; set; }
    }

A: You can use FirstOrDefault() to get your item. If there is no item with the id you will get null. That's why you have to check for null.
var item = magicItemList.FirstOrDefault(x => x.Id = itemId);
if(item != null)
{
    //do something with item
}

With your code you are getting a collection because you are checking one property and you'll get all items in your collection which are matching this property.
For more information have a look at the MSDN

A: It is going to fetch all instances that match your condition magicItem.Id == itemId.
If you are certain that that will be a single item, I recommend using query.FirstOrDefault() to get that item.

A: The problem is that you will not per se obtain one element: at code level it is unknown that the id is unique.
You can use .First() or .FirstOrDefault() to obtain the first element that matches the condition:
var query = (from MagicItem magicItem in magicItemList
                where magicItem.Id == itemId
                select magicItem).First();


text:
Q: (Python) Detecting arrow key(press) on Windows I tried to search for my answer before I posted, but I wasn't able to find anything that could help me here.
I currently have this in my script:
def waitForDir(self):
    while True:
        if msvcrt.kbhit():
            keyHit = msvcrt.getch()
            print keyHit

(It's part of a larger class)
Whenever I press the arrow keys, I get a pretty weird-looking symbol that kinda reminds me of a fish (think of an infinity symbol with the right half of the second loop cut off) and a letter -- K for left, H for up, M for right, P for down. (I'm using the arrow keys typically between the numpad and the main keyboard, below the home/insert/delete/all that jazz keys)
...how can I get this to something I can use? I want to run events whenever one of the keys is pressed, but I really don't know how to do it.
I can provide more info if I need to. Thanks in advance!
EDIT: Nevermind! I figured out the solution by enclosing msvcrt.getch() with ord() to get usable numbers. Thanks anyway!


text:
Q: How to simulate audio input to Microphone using .wav file My target is to use a .wav file as a substitute for microphone input in the Emulator. The .wav file has to be recognized and processed by the Speech Recorder in the Android emulator.
I want to test the Speech Recorder by giving voice commands from the .wav file, as if the app had received them through the microphone input.
Is this possible?


text:
Q: Create a text output based on if conditions are met or not I am not a coder, but I'm forced to code during an internship and could really need some help.
I am adapting already existing code and need to display a sentence on a dashboard if and only if old data is used for the output.
I was looking through Stack Overflow and thought that I should go with the conditional panel.
In the UI we are using radioButtons to select a month:
column(12,
       radioButtons("radio", h4(paste("Results:")),
       choices = list( "Jan" = paste(year(Sys.Date()-30), '-01-31', sep=""),
                       "Feb" = paste(year(Sys.Date()-30), '-02-28', sep=""),
                       "Mar" = paste(year(Sys.Date()-30), '-03-31', sep=""),
                       "Apr" = paste(year(Sys.Date()-30), '-04-30', sep=""),
                       "Mai" = paste(year(Sys.Date()-30), '-05-31', sep=""),
                       "Jun" = paste(year(Sys.Date()-30), '-06-30', sep="")
                       "Jul" = paste(year(Sys.Date()-30), '-07-31', sep=""),
                       "Aug" = paste(year(Sys.Date()-30), '-08-31', sep=""),
                       "Sep" = paste(year(Sys.Date()-30), '-09-30', sep=""),
                       "Oct" = paste(year(Sys.Date()-30), '-10-31', sep=""),
                       "Nov" = paste(year(Sys.Date()-30), '-11-30', sep=""),
                       "Dec" = paste(year(Sys.Date()-30), '-12-31', sep="")),

       selected = format(c(as.Date(d)-1),"%Y-%m-%d"), inline =TRUE)))

If I select a month on the radio buttons, for which we do not have the data yet, I display the latest information we have.
But I would also like to indicate this in a sentence above the plots.
So in the server, I tried this:
output$is_old_data <- renderText(
    if(max(dshb_qt_2$Data) < input$radio){
      1
    }else{
      0
    }
  )

And in the UI, I wanted to display it by this:
fluidRow(
          conditionalPanel("is_old_data == 1", "Old data was used")
         )

Unfortunately, it is now displaying "Old data was used" no matter if it is actually old data or not.
The if/else part does work. I know that because I have already used it for other parts.
Does someone know what do here?

A: Try this:
output$is_old_data <- reactive(
    if(max(dshb_qt_2$Data) < input$radio){
      1
    }else{
      0
    }
  )
outputOptions(output, "is_old_data", suspendWhenHidden = FALSE)

and in UI:
conditionalPanel(
  "output.is_old_data == 1",
  ......


text:
Q: give group2 rw permissions to folder1 and folder1/subfolder, and group1 rw to folder1, but only read to folder1/subfolder I have created 2 groups, let's called them -group1- and -group2-. I added 10 users to group1, and 2 users to group2.
Then I made these folders: /home/folder1/subfolder
I want that group2 has full r/w access to folder1 and its subfolder, but group1 should have r/w access only to /home/folder1, and read-only to /home/folder1/subfolder
How can I do this? Thanks.


text:
Q: Python char buffer In C code I have written a sub-function called read_ascii(data, recv_buf, &flag_end) to read the character from data to buffer recv_buf. In the main program:
int socket_in , new_sd , cc, go, flag_end;
struct sockaddr_in server , client;
char recv_buf[1024];
cc = sizeof(struct sockaddr_in);
data = accept(socket_in, (struct sockaddr *)&client, (socklen_t*)&cc);
while(1)
{ read_ascii(data, recv_buf, &flag_end);
  if (strncmp(recv_buf, "A", 1) == 0)
        {
        printf ("A");
        write(data, "ok", 2);
        }
  else if (strncmp(recv_buf, "B", 1) == 0)
        {
        printf ("B");
        write(data, "ok", 2);
        }
  else
        {
        write(data, "FAIL", 4);
        }
  }

In Python I know that no need to read the character like C, we can define recv_buf = "\0" * 1024 -- according to this.
But it seems thats the recv_buf buffer is overwritten each time I read the value of TCP/IP
while True:
   c, addr = server_tcp.accept()     # Establish connection with client.
   data = server_tcp.recv(1024)
   if 'A' == data
        n=server_tcp.send('OK')
   elif 'B'== data
        n=server_tcp.send('OK')
   else:
        print ('I did not get the right command DEF')
   break
 server_tcp.close()

Therefore when the client send B then A, I did get the good answer from server (OK, OK)
that i supposed.
Any help would be appreciated. Thank you


text:
Q: JUnit tests stuck The problem occurred after upgrade Spring Boot project to 3.01 and Java to 17. Also the pom.xml has been changed a lot. I'm not sure if it is a good idea to set all the version numbers manually, but the guy who did it, had some problems to get the dependencies work.
Now, I'm not able to run a JUnit test anymore, because it stucks after booting the framework. The test methods are not called. It doesn't matter, if I start the test from Intellij or from command line. I'm using the annotation @SpringBootTest in my tests.
In Intellij you can see, that Spring Boot framework is up, but the test method is grey and never runs. The test never finishes.

To change the Maven implemention, also had no effect. Locally I'm using Maven 3.8.3. To start Maven with 'mvn -X test' also didn't help.
I appreciate every hint.
Example test:
@SpringBootTest
class TaskCreateXPlanTest {

    Logger logger = LoggerFactory.getLogger(TaskCreateXPlanTest.class);

    @Test
    void test() {

        logger.info("Start!");
        logger.info("End!");

    }

}

UPDATE new pom.xml (problem still exists):
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.sample</groupId>
    <artifactId>Tool</artifactId>
    <version>0.2.12</version>
    <packaging>jar</packaging>
    <name>Tool</name>
    <description>new</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.2</version>
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>17</java.version>

        <!-- Jackson and XML/Excel -->
<!--        <jackson-version>2.14.1</jackson-version>-->
<!--        <jackson-databind-version>2.14.1</jackson-databind-version>-->
        <jackson-databind-nullable-version>0.2.4</jackson-databind-nullable-version>
        <jackson-threetenbp-version>2.12.5</jackson-threetenbp-version>
<!--        <javax-servlet-version>4.0.1</javax-servlet-version>-->
<!--        <jakarta-servlet-version>6.0.0</jakarta-servlet-version>-->
<!--        <jakarta-annotation-version>2.1.1</jakarta-annotation-version>-->
        <jxls-version>2.12.0</jxls-version>

        <!-- Google Libraries -->
        <gson-version>2.10.1</gson-version>
        <gson-fire-version>1.8.5</gson-fire-version>
        <google-findbugs-version>3.0.2</google-findbugs-version>

        <!-- DB and Building Libraries -->
        <h2-database-version>2.1.214</h2-database-version>
<!--        <maven-resources-plugin-version>3.3.0</maven-resources-plugin-version>      -->
<!--        <maven-compiler-plugin-version>3.10.1</maven-compiler-plugin-version>-->
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.source>17</maven.compiler.source>

        <!-- Apache Libraries -->
        <apache-commons-version>1.9.0</apache-commons-version>
        <commons-io-version>2.11.0</commons-io-version>
        <apache-poi-version>5.2.3</apache-poi-version>
        <apache-commons-lang-version>3.12.0</apache-commons-lang-version>

        <!-- Spring and related Libraries -->
<!--        <spring-latest-version>3.0.1</spring-latest-version>-->
<!--        <spring-thymeleaf-version>3.0.1</spring-thymeleaf-version>-->
<!--        <spring-security-version>6.0.1</spring-security-version>-->
<!--<!–        <spring-web-version>6.0.3</spring-web-version> –>-->
<!--        <spring-thymeleaf-extras-version>3.1.1.RELEASE</spring-thymeleaf-extras-version>-->
        <springdoc-openapi-ui-version>1.6.14</springdoc-openapi-ui-version>

        <!-- other libraries and newer versions of spring contained libraries -->
        <json-webtoken-version>0.11.5</json-webtoken-version>
        <lingala-zip4j-version>2.11.3</lingala-zip4j-version>
        <schegge-holidays-version>0.1.7</schegge-holidays-version>
        <snakeyaml-version>1.33</snakeyaml-version>
        <aerogear-otp-version>1.0.0</aerogear-otp-version>
<!--        <org-lombok-version>1.18.24</org-lombok-version>-->
        <itext-pdf-version>5.5.13.3</itext-pdf-version>
        <itext-html2pdf-version>4.0.4</itext-html2pdf-version>

    </properties>

    <dependencies>

        <!-- Spring Dependencies-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
<!--            <version>${spring-latest-version}</version>-->
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
<!--            <version>${spring-latest-version}</version>-->
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<!--        <dependency> -->
<!--            <groupId>org.springframework</groupId> -->
<!--            <artifactId>spring-web</artifactId> -->
<!--            <version>${spring-web-version}</version> -->
<!--        </dependency> -->

        <!-- Thymeleaf -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
<!--            <version>${spring-thymeleaf-version}</version>-->
        </dependency>
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-springsecurity6</artifactId>
<!--            <version>${spring-thymeleaf-extras-version}</version>-->
        </dependency>

        <!-- Spring Security Core -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
<!--            <version>${spring-security-version}</version>-->
        </dependency>

        <!-- Spring Security Config -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
<!--            <version>${spring-security-version}</version>-->
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-data -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-data</artifactId>
<!--            <version>${spring-security-version}</version>-->
        </dependency>

        <!-- Spring Security Web -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
<!--            <version>${spring-security-version}</version>-->
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
<!--            <version>${spring-security-version}</version>-->
            <scope>test</scope>
        </dependency>

        <!-- Swagger UI -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>${springdoc-openapi-ui-version}</version>
        </dependency>

        <!-- Spring Tools -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
<!--            <version>${spring-latest-version}</version>-->
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-properties-migrator</artifactId>
<!--            <version>${spring-latest-version}</version>-->
            <scope>runtime</scope>
        </dependency>

        <!-- Spring Test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
<!--            <version>${spring-latest-version}</version>-->
            <scope>test</scope>
        </dependency>

        <!-- validation -->
        <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-validation</artifactId>
<!--            <version>${spring-latest-version}</version>-->
        </dependency>

        <!-- Spring Mail -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
<!--            <version>${spring-latest-version}</version>-->
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
<!--            <version>${snakeyaml-version}</version>-->
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
<!--            <version>${h2-database-version}</version>-->
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
<!--            <version>${org-lombok-version}</version>-->
            <scope>provided</scope>
        </dependency>

        <!-- Apache Libraries -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>${apache-commons-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>${apache-poi-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${apache-poi-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
<!--            <version>${apache-commons-lang-version}</version>-->
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io-version}</version>
        </dependency>

        <!-- JSON processing: jackson -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
<!--            <version>${jackson-version}</version>-->
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
<!--            <version>${jackson-version}</version>-->
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
<!--            <version>${jackson-version}</version>-->
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
<!--            <version>${jackson-version}</version>-->
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
<!--            <version>${jackson-version}</version>-->
        </dependency>

        <dependency>
            <groupId>org.openapitools</groupId>
            <artifactId>jackson-databind-nullable</artifactId>
            <version>${jackson-databind-nullable-version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.joschi.jackson</groupId>
            <artifactId>jackson-datatype-threetenbp</artifactId>
            <version>${jackson-threetenbp-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
<!--            <version>${jakarta-servlet-version}</version>-->
            <scope>provided</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/jakarta.annotation/jakarta.annotation-api -->
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
<!--            <version>${jakarta-annotation-version}</version>-->
        </dependency>

        <!--  Working with Excel -->
        <!-- https://mvnrepository.com/artifact/org.jxls/jxls -->
        <dependency>
            <groupId>org.jxls</groupId>
            <artifactId>jxls</artifactId>
            <version>${jxls-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.jxls/jxls-poi -->
        <dependency>
            <groupId>org.jxls</groupId>
            <artifactId>jxls-poi</artifactId>
            <version>${jxls-version}</version>
        </dependency>

        <!-- Google Libraries -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>${google-findbugs-version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
<!--            <version>${gson-version}</version>-->
        </dependency>

        <!-- Json Webtoken Libraries -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>${json-webtoken-version}</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>${json-webtoken-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>${json-webtoken-version}</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Holidayserving Library for XPlan-Creation -->
        <dependency>
            <groupId>de.schegge</groupId>
            <artifactId>holidays</artifactId>
            <version>${schegge-holidays-version}</version>
        </dependency>

        <!-- Imports for Housekeeping and Monthplan serving -->
        <!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
        <dependency>
            <groupId>net.lingala.zip4j</groupId>
            <artifactId>zip4j</artifactId>
            <version>${lingala-zip4j-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>${itext-pdf-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.itextpdf/html2pdf -->
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>html2pdf</artifactId>
            <version>${itext-html2pdf-version}</version>
        </dependency>

        <!-- 2-Factor Authentication Library -->
        <dependency>
            <groupId>org.jboss.aerogear</groupId>
            <artifactId>aerogear-otp-java</artifactId>
            <version>${aerogear-otp-version}</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
<!--              <version>${maven-compiler-plugin-version}</version>-->
              <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
              </configuration>
            </plugin>
            <plugin>
                <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
<!--                <version>${maven-resources-plugin-version}</version>-->
                <configuration>
                    <delimiters>
                        <delimiter>@</delimiter>
                    </delimiters>
                    <useDefaultDelimiters>true</useDefaultDelimiters>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

old pom.xml:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>org.sample</groupId>
    <artifactId>Tool</artifactId>
    <version>0.2.12</version>
    <packaging>jar</packaging>
    <name>Tool</name>
    <description>new</description>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.1</version>
    </parent>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
        <java.version>17</java.version>

        <!-- Jackson and XML/Excel -->
        <jackson-version>2.14.1</jackson-version>
        <jackson-databind-version>2.14.1</jackson-databind-version>
        <jackson-databind-nullable-version>0.2.4</jackson-databind-nullable-version>
        <jackson-threetenbp-version>2.12.5</jackson-threetenbp-version>
        <javax-annotation-version>1.3.2</javax-annotation-version>
        <javax-servlet-version>4.0.1</javax-servlet-version>
        <jakarta-servlet-version>6.0.0</jakarta-servlet-version>
        <jakarta-annotation-version>2.1.1</jakarta-annotation-version>
        <jxls-version>2.12.0</jxls-version>

        <!-- Google Libraries -->
        <gson-version>2.10.1</gson-version>
        <gson-fire-version>1.8.5</gson-fire-version>
        <google-findbugs-version>3.0.2</google-findbugs-version>

        <!-- DB and Building Libraries -->
        <h2-database-version>2.1.214</h2-database-version>
        <maven-resources-plugin-version>3.3.0</maven-resources-plugin-version>
        <maven-compiler-plugin-version>3.10.1</maven-compiler-plugin-version>
        <maven.compiler.target>17</maven.compiler.target>
        <maven.compiler.source>17</maven.compiler.source>

        <!-- Apache Libraries -->
        <apache-commons-version>1.9.0</apache-commons-version>
        <commons-io-version>2.11.0</commons-io-version>
        <apache-poi-version>5.2.3</apache-poi-version>
        <apache-commons-lang-version>3.12.0</apache-commons-lang-version>

        <!-- Spring and related Libraries -->
        <spring-latest-version>3.0.1</spring-latest-version>
        <spring-thymeleaf-version>3.0.1</spring-thymeleaf-version>
        <spring-security-version>6.0.1</spring-security-version>
<!--        <spring-web-version>6.0.3</spring-web-version> -->
        <spring-thymeleaf-extras-version>3.1.1.RELEASE</spring-thymeleaf-extras-version>
        <springdoc-openapi-ui-version>1.6.14</springdoc-openapi-ui-version>

        <!-- other libraries and newer versions of spring contained libraries -->
        <json-webtoken-version>0.11.5</json-webtoken-version>
        <lingala-zip4j-version>2.11.3</lingala-zip4j-version>
        <schegge-holidays-version>0.1.7</schegge-holidays-version>
        <snakeyaml-version>1.33</snakeyaml-version>
        <aerogear-otp-version>1.0.0</aerogear-otp-version>
        <org-lombok-version>1.18.24</org-lombok-version>
        <itext-pdf-version>5.5.13.3</itext-pdf-version>
        <itext-html2pdf-version>4.0.4</itext-html2pdf-version>

    </properties>

    <dependencies>

        <!-- Spring Dependencies-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <version>${spring-latest-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
            <version>${spring-latest-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.springframework/spring-web -->
<!--        <dependency> -->
<!--            <groupId>org.springframework</groupId> -->
<!--            <artifactId>spring-web</artifactId> -->
<!--            <version>${spring-web-version}</version> -->
<!--        </dependency> -->

        <!-- Thymeleaf -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-thymeleaf</artifactId>
            <version>${spring-thymeleaf-version}</version>
        </dependency>
        <dependency>
            <groupId>org.thymeleaf.extras</groupId>
            <artifactId>thymeleaf-extras-springsecurity6</artifactId>
            <version>${spring-thymeleaf-extras-version}</version>
        </dependency>

        <!-- Spring Security Core -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-core</artifactId>
            <version>${spring-security-version}</version>
        </dependency>

        <!-- Spring Security Config -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-config</artifactId>
            <version>${spring-security-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework.security/spring-security-data -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-data</artifactId>
            <version>${spring-security-version}</version>
        </dependency>

        <!-- Spring Security Web -->
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-web</artifactId>
            <version>${spring-security-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.security</groupId>
            <artifactId>spring-security-test</artifactId>
            <version>${spring-security-version}</version>
            <scope>test</scope>
        </dependency>

        <!-- Swagger UI -->
        <dependency>
            <groupId>org.springdoc</groupId>
            <artifactId>springdoc-openapi-ui</artifactId>
            <version>${springdoc-openapi-ui-version}</version>
        </dependency>

        <!-- Spring Tools -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <version>${spring-latest-version}</version>
            <scope>runtime</scope>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-properties-migrator</artifactId>
            <version>${spring-latest-version}</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Spring Test -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <version>${spring-latest-version}</version>
            <scope>test</scope>
        </dependency>

        <!-- validation -->
        <dependency>
             <groupId>org.springframework.boot</groupId>
             <artifactId>spring-boot-starter-validation</artifactId>
            <version>${spring-latest-version}</version>
        </dependency>

        <!-- Spring Mail -->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
            <version>${spring-latest-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.yaml/snakeyaml -->
        <dependency>
            <groupId>org.yaml</groupId>
            <artifactId>snakeyaml</artifactId>
            <version>${snakeyaml-version}</version>
        </dependency>

        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
            <version>${h2-database-version}</version>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <version>${org-lombok-version}</version>
            <scope>provided</scope>
        </dependency>

        <!-- Apache Libraries -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-csv</artifactId>
            <version>${apache-commons-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi</artifactId>
            <version>${apache-poi-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.apache.poi/poi-ooxml -->
        <dependency>
            <groupId>org.apache.poi</groupId>
            <artifactId>poi-ooxml</artifactId>
            <version>${apache-poi-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.apache.commons/commons-lang3 -->
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>${apache-commons-lang-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/commons-io/commons-io -->
        <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>${commons-io-version}</version>
        </dependency>

        <!-- JSON processing: jackson -->
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-core</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-annotations</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.core</groupId>
            <artifactId>jackson-databind</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.jaxrs</groupId>
            <artifactId>jackson-jaxrs-json-provider</artifactId>
            <version>${jackson-version}</version>
        </dependency>
        <dependency>
            <groupId>com.fasterxml.jackson.datatype</groupId>
            <artifactId>jackson-datatype-jsr310</artifactId>
            <version>${jackson-version}</version>
        </dependency>

        <dependency>
            <groupId>org.openapitools</groupId>
            <artifactId>jackson-databind-nullable</artifactId>
            <version>${jackson-databind-nullable-version}</version>
        </dependency>
        <dependency>
            <groupId>com.github.joschi.jackson</groupId>
            <artifactId>jackson-datatype-threetenbp</artifactId>
            <version>${jackson-threetenbp-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/jakarta.servlet/jakarta.servlet-api -->
        <dependency>
            <groupId>jakarta.servlet</groupId>
            <artifactId>jakarta.servlet-api</artifactId>
            <version>${jakarta-servlet-version}</version>
            <scope>provided</scope>
        </dependency>
        <!-- https://mvnrepository.com/artifact/jakarta.annotation/jakarta.annotation-api -->
        <dependency>
            <groupId>jakarta.annotation</groupId>
            <artifactId>jakarta.annotation-api</artifactId>
            <version>${jakarta-annotation-version}</version>
        </dependency>

        <!--  Working with Excel -->
        <!-- https://mvnrepository.com/artifact/org.jxls/jxls -->
        <dependency>
            <groupId>org.jxls</groupId>
            <artifactId>jxls</artifactId>
            <version>${jxls-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/org.jxls/jxls-poi -->
        <dependency>
            <groupId>org.jxls</groupId>
            <artifactId>jxls-poi</artifactId>
            <version>${jxls-version}</version>
        </dependency>

        <!-- Google Libraries -->
        <dependency>
            <groupId>com.google.code.findbugs</groupId>
            <artifactId>jsr305</artifactId>
            <version>${google-findbugs-version}</version>
        </dependency>
        <dependency>
            <groupId>com.google.code.gson</groupId>
            <artifactId>gson</artifactId>
            <version>${gson-version}</version>
        </dependency>

        <!-- Json Webtoken Libraries -->
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-api</artifactId>
            <version>${json-webtoken-version}</version>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-impl</artifactId>
            <version>${json-webtoken-version}</version>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>io.jsonwebtoken</groupId>
            <artifactId>jjwt-jackson</artifactId>
            <version>${json-webtoken-version}</version>
            <scope>runtime</scope>
        </dependency>

        <!-- Holidayserving Library for XPlan-Creation -->
        <dependency>
            <groupId>de.schegge</groupId>
            <artifactId>holidays</artifactId>
            <version>${schegge-holidays-version}</version>
        </dependency>

        <!-- Imports for Housekeeping and Monthplan serving -->
        <!-- https://mvnrepository.com/artifact/net.lingala.zip4j/zip4j -->
        <dependency>
            <groupId>net.lingala.zip4j</groupId>
            <artifactId>zip4j</artifactId>
            <version>${lingala-zip4j-version}</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.itextpdf/itextpdf -->
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>itextpdf</artifactId>
            <version>${itext-pdf-version}</version>
        </dependency>
        <!-- https://mvnrepository.com/artifact/com.itextpdf/html2pdf -->
        <dependency>
            <groupId>com.itextpdf</groupId>
            <artifactId>html2pdf</artifactId>
            <version>${itext-html2pdf-version}</version>
        </dependency>

        <!-- 2-Factor Authentication Library -->
        <dependency>
            <groupId>org.jboss.aerogear</groupId>
            <artifactId>aerogear-otp-java</artifactId>
            <version>${aerogear-otp-version}</version>
        </dependency>

    </dependencies>

    <build>
        <plugins>
            <plugin>
              <groupId>org.apache.maven.plugins</groupId>
              <artifactId>maven-compiler-plugin</artifactId>
              <version>${maven-compiler-plugin-version}</version>
              <configuration>
                <source>${maven.compiler.source}</source>
                <target>${maven.compiler.target}</target>
              </configuration>
            </plugin>
            <plugin>
                <!-- https://mvnrepository.com/artifact/org.apache.maven.plugins/maven-resources-plugin -->
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>${maven-resources-plugin-version}</version>
                <configuration>
                    <delimiters>
                        <delimiter>@</delimiter>
                    </delimiters>
                    <useDefaultDelimiters>true</useDefaultDelimiters>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

</project>

A: This is no general problem. Some code in the main Application class led into a continuous loop.
I was able to find the problem, by using the "Get Thread Dump" button of the debugger (IntelliJ).