问:
After new Login app show old user data from firebase
I am trying to display current user data from Firebase, and it works totally fine, but when I logout and login with a new email ID, the app also shows previous user data instead of new user login data.

My signIn function in Signin page

```<code>class LoginPage extends StatefulWidget {
  //when user is login then save their userid and after use this for fetching current user data
  //this help in StudentData.dart page
  var userId;
  @override
  State<LoginPage> createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
  final emailController = TextEditingController();
  final passwordController = TextEditingController();

  //for Validation
  final _key = GlobalKey<FormState>();

  //for geeting input and store email & password
  var email = "";
  var password = "";

  //for Loading Indicator
  bool isLodaing = false;

  //for login
  Future userLogin() async {
    //check internet is on or not
    final ip = context.read<InternetProvider>();
    await ip.checkInternetConnection();

    //for checking Internet
    if (ip.hasInternet == false) {
      openSnackbar(context, "Check your internet connection", Colors.red);
    } else {
      try {
        UserCredential userCredential = await FirebaseAuth.instance
            .signInWithEmailAndPassword(email: email, password: password);

        //when user loged in that time save user id that help after for fetch data in StudentData.dart page
        // widget.userId = userCredential.user!.uid;
        setState(() {
          widget.userId = userCredential.user!.uid;
          print("User id is : " + userCredential.user!.uid);
        });
        print("Widget User id is : " + widget.userId);

        //show succuful log-in meesage
        openSnackbar(
            context, "Log-in Successfull", Color.fromARGB(255, 70, 213, 92));

        //after login go to profile Page
        Navigator.pushReplacement(
            context, MaterialPageRoute(builder: (context) => FirstPage()));
      } on FirebaseAuthException catch (e) {
        //for no user Found
        if (e.code == 'user-not-found') {
          //for stoping the loading indicator when user get this error
          Future.delayed(
            Duration(seconds: 0),
            () {
              setState(() {
                isLodaing = false;
              });
            },
          );

          //show Snack Bar when this error occur
          openSnackbar(context, "No User Found for this e-mail", Colors.red);
        }

        //for Wrong Password
        else if (e.code == 'wrong-password') {
          //for stoping the loading indicator when user get this error
          Future.delayed(
            Duration(seconds: 0),
            () {
              setState(() {
                isLodaing = false;
              });
            },
          );

          //show Snack Bar when this error occur
          openSnackbar(context, "Wrong Password", Colors.red);
        }
      }
    }
  }

  @override
  void dispose() {
    emailController.dispose();
    passwordController.dispose();

    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        backgroundColor: HexColor("#F9B684"),
        body: GestureDetector(
          //when user tap on screen tahat time keybord disumissed
          //this is use for avoiding overflow screen
          onTap: () => FocusScope.of(context).unfocus(),

          child: SingleChildScrollView(
            child: Column(
                // this is main Column
                children: [
                  //Heading
                  Container(
                    margin: EdgeInsets.only(top: 80, left: 20),
                    padding: EdgeInsets.only(left: 75, top: 13),
                    height: 80,
                    width: 265,
                    // color: Colors.white,
                    child: Text(
                      'Login',
                      style: TextStyle(
                        fontFamily: 'Ubuntu',
                        fontWeight: FontWeight.bold,
                        fontSize: 43,
                        color: HexColor("#2D0C03"),
                      ),
                    ),
                  ),

                  //for image
                  Container(
                    margin: EdgeInsets.only(left: 10),
                    height: 200,
                    width: 265,
                    // color: Colors.white,
                    child: Image.asset("assets/images/login.gif",
                        fit: BoxFit.cover),
                  ),

                  const SizedBox(height: 17),

                  //for TextFileds
                  Form(
                    key: _key,
                    child: Padding(
                      padding: const EdgeInsets.symmetric(horizontal: 23.0),
                      child: Column(
                        children: [
                          //for E-mail Text Filed
                          TextFormField(
                            keyboardType: TextInputType.emailAddress,

                            //for move to cursor next Text automatically
                            textInputAction: TextInputAction.next,

                            //for autofil e-mail
                            autofillHints: [AutofillHints.email],
                            controller: emailController,
                            decoration: InputDecoration(
                              filled: true,
                              fillColor: Colors.white,
                              prefixIcon: Icon(
                                Icons.email,
                                color: HexColor("#002C00"),
                              ),
                              hintText: "e-mail",
                              border: OutlineInputBorder(
                                  borderRadius: BorderRadius.circular(33)),
                              focusedBorder: OutlineInputBorder(
                                borderSide:
                                    BorderSide(color: HexColor("#002C00")),
                                borderRadius: BorderRadius.circular(25.7),
                              ),
                              enabledBorder: UnderlineInputBorder(
                                borderSide:
                                    const BorderSide(color: Colors.white),
                                borderRadius: BorderRadius.circular(25.7),
                              ),
                            ),

                            //for validation
                            validator: (value) =>
                                value != null && !EmailValidator.validate(value)
                                    ? 'Enter valid e-mail'
                                    : null,
                          ),

                          const SizedBox(height: 10),

                          //for Password Text Filed
                          TextFormField(
                            controller: passwordController,
                            decoration: InputDecoration(
                              filled: true,
                              fillColor: Colors.white,
                              prefixIcon: Icon(
                                Icons.password,
                                color: HexColor("#002C00"),
                              ),
                              hintText: "password",
                              border: OutlineInputBorder(
                                  borderRadius: BorderRadius.circular(33)),
                              focusedBorder: OutlineInputBorder(
                                borderSide:
                                    BorderSide(color: HexColor("#002C00")),
                                borderRadius: BorderRadius.circular(25.7),
                              ),
                              enabledBorder: UnderlineInputBorder(
                                borderSide:
                                    const BorderSide(color: Colors.white),
                                borderRadius: BorderRadius.circular(25.7),
                              ),
                            ),

                            //for validation
                            validator: (value) {
                              if (value == null || value.isEmpty) {
                                return "Please enter password";
                              }
                              return null;
                            },
                          ),

                          //for forget Password
                          Container(
                            margin: const EdgeInsets.only(top: 4),
                            // color: Colors.yellow,
                            height: 35,
                            width: MediaQuery.of(context).size.width,
                            alignment: Alignment.bottomRight,
                            child: TextButton(
                              onPressed: () {
                                //goto Forget Password Screen
                                nextScreen(context, ForgetPassword_Page());
                              },
                              child: const Text(
                                "Forgot Password",
                                textAlign: TextAlign.right,
                                style: TextStyle(
                                    fontFamily: 'Gotham',
                                    color: Color(0xff1778F2),
                                    fontSize: 14.5),
                              ),
                            ),
                          ),

                          const SizedBox(height: 9),

                          //for sign-in Button
                          SizedBox(
                            height: 50,
                            width: 170,
                            child: ElevatedButton.icon(
                              style: ElevatedButton.styleFrom(
                                primary: HexColor("#98504B"),
                                shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(50),
                                ),
                              ),

                              //for loading indicator and Text
                              icon: isLodaing
                                  ? const SizedBox()
                                  : const Icon(Icons.arrow_forward, size: 24),

                              label: isLodaing
                                  ? Row(
                                      children: [
                                        //for circular indicator
                                        Container(
                                          margin:
                                              const EdgeInsets.only(left: 7),
                                          height: 25,
                                          width: 25,
                                          child: CircularProgressIndicator(
                                            color: HexColor("#2D0C03"),
                                            strokeWidth: 3.5,
                                            backgroundColor: Colors.white,
                                          ),
                                        ),

                                        //for text
                                        Container(
                                          margin:
                                              const EdgeInsets.only(left: 7),
                                          child: Text(
                                            "Please Wait..",
                                            style: TextStyle(
                                                fontFamily: 'Gotham',
                                                color: Colors.white),
                                          ),
                                        ),
                                      ],
                                    )
                                  : const Text(
                                      'Sign-in',
                                      style: const TextStyle(
                                          fontFamily: 'Gotham', fontSize: 22),
                                    ),

                              //here we call method name signup for storing data in firebase
                              onPressed: () async {
                                //for validation
                                if (_key.currentState!.validate()) {
                                  isLodaing = true;
                                  setState(() {
                                    //when user enter email & password then store those email and passwors in variable which intialize in top
                                    email = emailController.text;
                                    password = passwordController.text;
                                  });

                                  //for Showing Loaing Indicator
                                  Future.delayed(
                                    Duration(seconds: 3),
                                    () {
                                      setState(() {
                                        isLodaing = true;
                                      });
                                    },
                                  );

                                  //for user login
                                  userLogin();
                                }

                                //after run above line of code this Stop the Loading Indicator
                                Future.delayed(
                                  Duration(seconds: 3),
                                  () {
                                    setState(() {
                                      isLodaing = false;
                                    });
                                  },
                                );
                              },
                            ),
                          ),

                          //for sign-up opotion below login button
                          Container(
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.center,
                              children: [
                                Text('Does Not Have Account? '),
                                TextButton(
                                  onPressed: () {
                                    nextScreen(context, RegistrationPage());
                                  },
                                  child: const Text(
                                    "Sign-UP",
                                    style: TextStyle(
                                      letterSpacing: 0.2,
                                      fontFamily: "Ubuntu",
                                      fontSize: 16,
                                      color: Color(0xff1778F2),
                                    ),
                                  ),
                                )
                              ],
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ]),
          ),
        ),
      ),
    );
  }
}
</code>```

UserData controller Class:

```<code>import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:get/get.dart';
import 'package:gtu_all_in_one/Pages/LoginPage.dart';

//this class help for fetching current user info from firebase
class StudentDataController extends GetxController {
  final firebaseInstance = FirebaseFirestore.instance;

  //after data fetch insert data in this
  Map StudentProfileData = {
    'name': '',
    'EnrollmentNo': '',
    'Email': '',
    'Branch&Sem': ''
  };

  //create loginpage instance for getting current user userid , using this we fetch the data
  LoginPage authController = LoginPage();

  @override
  void onReady() {
    super.onReady();
    getStudentProfileData();
  }

  Future<void> getStudentProfileData() async {
    // print("user id ${authController.userId}");
    try {
      var response = await firebaseInstance
          .collection('users')
          .where('user_Id', isEqualTo: authController.userId)
          .get();
      // response.docs.forEach((result) {
      //   print(result.data());
      // });
      if (response.docs.length > 0) {
        StudentProfileData['name'] = response.docs[0]['name'];
        StudentProfileData['EnrollmentNo'] = response.docs[0]['EnrollmentNo'];
        StudentProfileData['Email'] = response.docs[0]['Email'];
        StudentProfileData['Branch&Sem'] = response.docs[0]['Branch&Sem'];
      }
      print(StudentProfileData);
    } on FirebaseException catch (e) {
      print(e);
    } catch (error) {
      print(error);
    }
  }
}
</code>```

And profile Page where i trying to display current user data:

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

  @override
  State<ProfilePage> createState() => _ProfilePageState();
}

class _ProfilePageState extends State<ProfilePage> {
  //when user come in profile page after login that time this create instance of StudentDataController and go to StudentData Page
  final StudentDataController controller = Get.put(StudentDataController());

  @override
  Widget build(BuildContext context) {
    // for logout button
    final sp = context.watch<SignInProvider>();

    return SafeArea(
      child: Scaffold(
        resizeToAvoidBottomInset: false,
        body: Center(
          child: Column(
            children: [
              SizedBox(height: 300),

              Text("Name : ${controller.StudentProfileData['name']} "),
              Text(
                  "Enrollment No : ${controller.StudentProfileData['EnrollmentNo']} "),
              Text("Email  : ${controller.StudentProfileData['Email']} "),
              Text(
                  " Branch& Sem : ${controller.StudentProfileData['Branch&Sem']} "),

              SizedBox(height: 10),

              SizedBox(height: 10),

              //for Opening QR Code Scanner
              SizedBox(
                height: 50,
                width: 250,
                child: ElevatedButton(
                  style: ElevatedButton.styleFrom(
                    primary: HexColor("#48EDC5"),
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(22),
                    ),
                  ),

                  child: Row(
                    children: [
                      //for text
                      Container(
                        margin: const EdgeInsets.only(left: 13),
                        child: Text(
                          "Mark Attendance",
                          style: TextStyle(
                              fontFamily: 'Gotham',
                              color: HexColor("#002C00"),
                              fontSize: 20),
                        ),
                      ),

                      //for Icone
                      Container(
                        margin: EdgeInsets.only(left: 5),
                        child: Icon(
                          Icons.qr_code_scanner,
                          size: 22,
                          color: HexColor("#002C00"),
                        ),
                      ),
                    ],
                  ),

                  //goto QR Code Scanner Page
                  onPressed: () {
                    nextScreen(context, QRCodeScanner());
                  },
                ),
              ),

              SizedBox(height: 10),

              //for LogOut Button
              SizedBox(
                height: 50,
                width: 150,
                child: ElevatedButton(
                  style: ElevatedButton.styleFrom(
                    primary: HexColor("#48EDC5"),
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(22),
                    ),
                  ),

                  child: Row(
                    children: [
                      //for text
                      Container(
                        margin: const EdgeInsets.only(left: 13),
                        child: Text(
                          "log Out",
                          style: TextStyle(
                              fontFamily: 'Gotham',
                              color: HexColor("#002C00"),
                              fontSize: 20),
                        ),
                      ),

                      //for Icone
                      Container(
                        margin: EdgeInsets.only(left: 5),
                        child: Icon(
                          Icons.arrow_forward_ios,
                          size: 22,
                          color: HexColor("#002C00"),
                        ),
                      ),
                    ],
                  ),

                  //goto SignUp Page
                  onPressed: () {
                    sp.userSignOut();
                    nextScreenReplace(context, FirstPage());
                  },
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
</code>```

Body:
I am trying to display current user data from Firebase, and it works totally fine, but when I logout and login with a new email ID, the app also shows previous user data instead of new user login data.

My signIn function in Signin page

class LoginPage extends StatefulWidget {
  //when user is login then save their userid and after use this for fetching current user data
  //this help in StudentData.dart page
  var userId;
  @override
  State<LoginPage> createState() => _LoginPageState();
}

class _LoginPageState extends State<LoginPage> {
  final emailController = TextEditingController();
  final passwordController = TextEditingController();

  //for Validation
  final _key = GlobalKey<FormState>();

  //for geeting input and store email & password
  var email = "";
  var password = "";

  //for Loading Indicator
  bool isLodaing = false;

  //for login
  Future userLogin() async {
    //check internet is on or not
    final ip = context.read<InternetProvider>();
    await ip.checkInternetConnection();

    //for checking Internet
    if (ip.hasInternet == false) {
      openSnackbar(context, "Check your internet connection", Colors.red);
    } else {
      try {
        UserCredential userCredential = await FirebaseAuth.instance
            .signInWithEmailAndPassword(email: email, password: password);

        //when user loged in that time save user id that help after for fetch data in StudentData.dart page
        // widget.userId = userCredential.user!.uid;
        setState(() {
          widget.userId = userCredential.user!.uid;
          print("User id is : " + userCredential.user!.uid);
        });
        print("Widget User id is : " + widget.userId);

        //show succuful log-in meesage
        openSnackbar(
            context, "Log-in Successfull", Color.fromARGB(255, 70, 213, 92));

        //after login go to profile Page
        Navigator.pushReplacement(
            context, MaterialPageRoute(builder: (context) => FirstPage()));
      } on FirebaseAuthException catch (e) {
        //for no user Found
        if (e.code == 'user-not-found') {
          //for stoping the loading indicator when user get this error
          Future.delayed(
            Duration(seconds: 0),
            () {
              setState(() {
                isLodaing = false;
              });
            },
          );

          //show Snack Bar when this error occur
          openSnackbar(context, "No User Found for this e-mail", Colors.red);
        }

        //for Wrong Password
        else if (e.code == 'wrong-password') {
          //for stoping the loading indicator when user get this error
          Future.delayed(
            Duration(seconds: 0),
            () {
              setState(() {
                isLodaing = false;
              });
            },
          );

          //show Snack Bar when this error occur
          openSnackbar(context, "Wrong Password", Colors.red);
        }
      }
    }
  }

  @override
  void dispose() {
    emailController.dispose();
    passwordController.dispose();

    super.dispose();
  }

  @override
  Widget build(BuildContext context) {
    return SafeArea(
      child: Scaffold(
        backgroundColor: HexColor("#F9B684"),
        body: GestureDetector(
          //when user tap on screen tahat time keybord disumissed
          //this is use for avoiding overflow screen
          onTap: () => FocusScope.of(context).unfocus(),

          child: SingleChildScrollView(
            child: Column(
                // this is main Column
                children: [
                  //Heading
                  Container(
                    margin: EdgeInsets.only(top: 80, left: 20),
                    padding: EdgeInsets.only(left: 75, top: 13),
                    height: 80,
                    width: 265,
                    // color: Colors.white,
                    child: Text(
                      'Login',
                      style: TextStyle(
                        fontFamily: 'Ubuntu',
                        fontWeight: FontWeight.bold,
                        fontSize: 43,
                        color: HexColor("#2D0C03"),
                      ),
                    ),
                  ),

                  //for image
                  Container(
                    margin: EdgeInsets.only(left: 10),
                    height: 200,
                    width: 265,
                    // color: Colors.white,
                    child: Image.asset("assets/images/login.gif",
                        fit: BoxFit.cover),
                  ),

                  const SizedBox(height: 17),

                  //for TextFileds
                  Form(
                    key: _key,
                    child: Padding(
                      padding: const EdgeInsets.symmetric(horizontal: 23.0),
                      child: Column(
                        children: [
                          //for E-mail Text Filed
                          TextFormField(
                            keyboardType: TextInputType.emailAddress,

                            //for move to cursor next Text automatically
                            textInputAction: TextInputAction.next,

                            //for autofil e-mail
                            autofillHints: [AutofillHints.email],
                            controller: emailController,
                            decoration: InputDecoration(
                              filled: true,
                              fillColor: Colors.white,
                              prefixIcon: Icon(
                                Icons.email,
                                color: HexColor("#002C00"),
                              ),
                              hintText: "e-mail",
                              border: OutlineInputBorder(
                                  borderRadius: BorderRadius.circular(33)),
                              focusedBorder: OutlineInputBorder(
                                borderSide:
                                    BorderSide(color: HexColor("#002C00")),
                                borderRadius: BorderRadius.circular(25.7),
                              ),
                              enabledBorder: UnderlineInputBorder(
                                borderSide:
                                    const BorderSide(color: Colors.white),
                                borderRadius: BorderRadius.circular(25.7),
                              ),
                            ),

                            //for validation
                            validator: (value) =>
                                value != null && !EmailValidator.validate(value)
                                    ? 'Enter valid e-mail'
                                    : null,
                          ),

                          const SizedBox(height: 10),

                          //for Password Text Filed
                          TextFormField(
                            controller: passwordController,
                            decoration: InputDecoration(
                              filled: true,
                              fillColor: Colors.white,
                              prefixIcon: Icon(
                                Icons.password,
                                color: HexColor("#002C00"),
                              ),
                              hintText: "password",
                              border: OutlineInputBorder(
                                  borderRadius: BorderRadius.circular(33)),
                              focusedBorder: OutlineInputBorder(
                                borderSide:
                                    BorderSide(color: HexColor("#002C00")),
                                borderRadius: BorderRadius.circular(25.7),
                              ),
                              enabledBorder: UnderlineInputBorder(
                                borderSide:
                                    const BorderSide(color: Colors.white),
                                borderRadius: BorderRadius.circular(25.7),
                              ),
                            ),

                            //for validation
                            validator: (value) {
                              if (value == null || value.isEmpty) {
                                return "Please enter password";
                              }
                              return null;
                            },
                          ),

                          //for forget Password
                          Container(
                            margin: const EdgeInsets.only(top: 4),
                            // color: Colors.yellow,
                            height: 35,
                            width: MediaQuery.of(context).size.width,
                            alignment: Alignment.bottomRight,
                            child: TextButton(
                              onPressed: () {
                                //goto Forget Password Screen
                                nextScreen(context, ForgetPassword_Page());
                              },
                              child: const Text(
                                "Forgot Password",
                                textAlign: TextAlign.right,
                                style: TextStyle(
                                    fontFamily: 'Gotham',
                                    color: Color(0xff1778F2),
                                    fontSize: 14.5),
                              ),
                            ),
                          ),

                          const SizedBox(height: 9),

                          //for sign-in Button
                          SizedBox(
                            height: 50,
                            width: 170,
                            child: ElevatedButton.icon(
                              style: ElevatedButton.styleFrom(
                                primary: HexColor("#98504B"),
                                shape: RoundedRectangleBorder(
                                  borderRadius: BorderRadius.circular(50),
                                ),
                              ),

                              //for loading indicator and Text
                              icon: isLodaing
                                  ? const SizedBox()
                                  : const Icon(Icons.arrow_forward, size: 24),

                              label: isLodaing
                                  ? Row(
                                      children: [
                                        //for circular indicator
                                        Container(
                                          margin:
                                              const EdgeInsets.only(left: 7),
                                          height: 25,
                                          width: 25,
                                          child: CircularProgressIndicator(
                                            color: HexColor("#2D0C03"),
                                            strokeWidth: 3.5,
                                            backgroundColor: Colors.white,
                                          ),
                                        ),

                                        //for text
                                        Container(
                                          margin:
                                              const EdgeInsets.only(left: 7),
                                          child: Text(
                                            "Please Wait..",
                                            style: TextStyle(
                                                fontFamily: 'Gotham',
                                                color: Colors.white),
                                          ),
                                        ),
                                      ],
                                    )
                                  : const Text(
                                      'Sign-in',
                                      style: const TextStyle(
                                          fontFamily: 'Gotham', fontSize: 22),
                                    ),

                              //here we call method name signup for storing data in firebase
                              onPressed: () async {
                                //for validation
                                if (_key.currentState!.validate()) {
                                  isLodaing = true;
                                  setState(() {
                                    //when user enter email & password then store those email and passwors in variable which intialize in top
                                    email = emailController.text;
                                    password = passwordController.text;
                                  });

                                  //for Showing Loaing Indicator
                                  Future.delayed(
                                    Duration(seconds: 3),
                                    () {
                                      setState(() {
                                        isLodaing = true;
                                      });
                                    },
                                  );

                                  //for user login
                                  userLogin();
                                }

                                //after run above line of code this Stop the Loading Indicator
                                Future.delayed(
                                  Duration(seconds: 3),
                                  () {
                                    setState(() {
                                      isLodaing = false;
                                    });
                                  },
                                );
                              },
                            ),
                          ),

                          //for sign-up opotion below login button
                          Container(
                            child: Row(
                              mainAxisAlignment: MainAxisAlignment.center,
                              children: [
                                Text('Does Not Have Account? '),
                                TextButton(
                                  onPressed: () {
                                    nextScreen(context, RegistrationPage());
                                  },
                                  child: const Text(
                                    "Sign-UP",
                                    style: TextStyle(
                                      letterSpacing: 0.2,
                                      fontFamily: "Ubuntu",
                                      fontSize: 16,
                                      color: Color(0xff1778F2),
                                    ),
                                  ),
                                )
                              ],
                            ),
                          ),
                        ],
                      ),
                    ),
                  ),
                ]),
          ),
        ),
      ),
    );
  }
}

UserData controller Class:

import 'package:cloud_firestore/cloud_firestore.dart';
import 'package:get/get.dart';
import 'package:gtu_all_in_one/Pages/LoginPage.dart';

//this class help for fetching current user info from firebase
class StudentDataController extends GetxController {
  final firebaseInstance = FirebaseFirestore.instance;

  //after data fetch insert data in this
  Map StudentProfileData = {
    'name': '',
    'EnrollmentNo': '',
    'Email': '',
    'Branch&Sem': ''
  };

  //create loginpage instance for getting current user userid , using this we fetch the data
  LoginPage authController = LoginPage();

  @override
  void onReady() {
    super.onReady();
    getStudentProfileData();
  }

  Future<void> getStudentProfileData() async {
    // print("user id ${authController.userId}");
    try {
      var response = await firebaseInstance
          .collection('users')
          .where('user_Id', isEqualTo: authController.userId)
          .get();
      // response.docs.forEach((result) {
      //   print(result.data());
      // });
      if (response.docs.length > 0) {
        StudentProfileData['name'] = response.docs[0]['name'];
        StudentProfileData['EnrollmentNo'] = response.docs[0]['EnrollmentNo'];
        StudentProfileData['Email'] = response.docs[0]['Email'];
        StudentProfileData['Branch&Sem'] = response.docs[0]['Branch&Sem'];
      }
      print(StudentProfileData);
    } on FirebaseException catch (e) {
      print(e);
    } catch (error) {
      print(error);
    }
  }
}

And profile Page where i trying to display current user data:

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

  @override
  State<ProfilePage> createState() => _ProfilePageState();
}

class _ProfilePageState extends State<ProfilePage> {
  //when user come in profile page after login that time this create instance of StudentDataController and go to StudentData Page
  final StudentDataController controller = Get.put(StudentDataController());

  @override
  Widget build(BuildContext context) {
    // for logout button
    final sp = context.watch<SignInProvider>();

    return SafeArea(
      child: Scaffold(
        resizeToAvoidBottomInset: false,
        body: Center(
          child: Column(
            children: [
              SizedBox(height: 300),

              Text("Name : ${controller.StudentProfileData['name']} "),
              Text(
                  "Enrollment No : ${controller.StudentProfileData['EnrollmentNo']} "),
              Text("Email  : ${controller.StudentProfileData['Email']} "),
              Text(
                  " Branch& Sem : ${controller.StudentProfileData['Branch&Sem']} "),

              SizedBox(height: 10),

              SizedBox(height: 10),

              //for Opening QR Code Scanner
              SizedBox(
                height: 50,
                width: 250,
                child: ElevatedButton(
                  style: ElevatedButton.styleFrom(
                    primary: HexColor("#48EDC5"),
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(22),
                    ),
                  ),

                  child: Row(
                    children: [
                      //for text
                      Container(
                        margin: const EdgeInsets.only(left: 13),
                        child: Text(
                          "Mark Attendance",
                          style: TextStyle(
                              fontFamily: 'Gotham',
                              color: HexColor("#002C00"),
                              fontSize: 20),
                        ),
                      ),

                      //for Icone
                      Container(
                        margin: EdgeInsets.only(left: 5),
                        child: Icon(
                          Icons.qr_code_scanner,
                          size: 22,
                          color: HexColor("#002C00"),
                        ),
                      ),
                    ],
                  ),

                  //goto QR Code Scanner Page
                  onPressed: () {
                    nextScreen(context, QRCodeScanner());
                  },
                ),
              ),

              SizedBox(height: 10),

              //for LogOut Button
              SizedBox(
                height: 50,
                width: 150,
                child: ElevatedButton(
                  style: ElevatedButton.styleFrom(
                    primary: HexColor("#48EDC5"),
                    shape: RoundedRectangleBorder(
                      borderRadius: BorderRadius.circular(22),
                    ),
                  ),

                  child: Row(
                    children: [
                      //for text
                      Container(
                        margin: const EdgeInsets.only(left: 13),
                        child: Text(
                          "log Out",
                          style: TextStyle(
                              fontFamily: 'Gotham',
                              color: HexColor("#002C00"),
                              fontSize: 20),
                        ),
                      ),

                      //for Icone
                      Container(
                        margin: EdgeInsets.only(left: 5),
                        child: Icon(
                          Icons.arrow_forward_ios,
                          size: 22,
                          color: HexColor("#002C00"),
                        ),
                      ),
                    ],
                  ),

                  //goto SignUp Page
                  onPressed: () {
                    sp.userSignOut();
                    nextScreenReplace(context, FirstPage());
                  },
                ),
              ),
            ],
          ),
        ),
      ),
    );
  }
}


来源: stackexchange

问:
GitHub Actions ./gradlew build job succeed but does not create build directory
I am trying to make CI process with GitHub Actions for Android project. Before making a real process, the goal is to build gradle and debug apk file automatically.

The job succeed for each step, however, neither build directory nor apk file is being created.

I read various posts and tried each post suggests, but nothing gave me a solution.

What part do I need to change to get the desired result?

Firstly, Below is log I got from ./gradlew build command. It says that the process definitely has gotten into :app:build

> Task :app:lintDebug
> Task :app:lint
> Task :app:check
> Task :app:build

BUILD SUCCESSFUL in 1m 22s
```
<p>And here is a GitHub Actions Job I made.</p>
<h3>Android_CI_Test.yml</h3>
<pre class="lang-yaml prettyprint-override"><code>name: Android CI Test

on:
  pull_request:
    branches:
      - main
      - release
      - dev
      - staging
  push:
    branches:
      - main
      - release

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Set Up java
        id: set_up_java
        uses: actions/setup-java@v3
        with:
          java-version: 11
          distribution: "corretto"

      - name: Set Android SDK
        uses: android-actions/setup-android@v2

      - name: Cache Gradle
        uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
          restore-keys: |
            ${{ runner.os }}-gradle-

      - name: Grand Gradlew Permission
        id: grand_gradlew_permission
        run: chmod +x ./gradlew

      - name: Validate Gradlew
        id: validate_gradlew
        uses: gradle/wrapper-validation-action@v1

      - name: Set Up Gradle
        id: set_up_gradle
        uses: gradle/gradle-build-action@v2

      - name: Build
        id: build_gradle
        run: ./gradlew build

      - name: Build debug APK
        id: build_debug_apk
        run: ./gradlew assembleDebug --stacktrace
</code>```

I tried changing Grand Gradlew Permission to chmod +x ./gradlew , changing Build debug APK to bash ./gradlew assembleDebug or ./gradlew app:assembleDebug but none of them has succeeded.

ContentLicense: CC BY-SA 4.0

Body:
I am trying to make CI process with GitHub Actions for Android project. Before making a real process, the goal is to build gradle and debug apk file automatically.

The job succeed for each step, however, neither build directory nor apk file is being created.

I read various posts and tried each post suggests, but nothing gave me a solution.

What part do I need to change to get the desired result?

Firstly, Below is log I got from ./gradlew build command. It says that the process definitely has gotten into :app:build

> Task :app:lintDebug
> Task :app:lint
> Task :app:check
> Task :app:build

BUILD SUCCESSFUL in 1m 22s

And here is a GitHub Actions Job I made.

Android_CI_Test.yml

name: Android CI Test

on:
  pull_request:
    branches:
      - main
      - release
      - dev
      - staging
  push:
    branches:
      - main
      - release

jobs:
  setup:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3

      - name: Set Up java
        id: set_up_java
        uses: actions/setup-java@v3
        with:
          java-version: 11
          distribution: "corretto"

      - name: Set Android SDK
        uses: android-actions/setup-android@v2

      - name: Cache Gradle
        uses: actions/cache@v2
        with:
          path: |
            ~/.gradle/caches
            ~/.gradle/wrapper
          key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/buildSrc/**/*.kt') }}
          restore-keys: |
            ${{ runner.os }}-gradle-

      - name: Grand Gradlew Permission
        id: grand_gradlew_permission
        run: chmod +x ./gradlew

      - name: Validate Gradlew
        id: validate_gradlew
        uses: gradle/wrapper-validation-action@v1

      - name: Set Up Gradle
        id: set_up_gradle
        uses: gradle/gradle-build-action@v2

      - name: Build
        id: build_gradle
        run: ./gradlew build

      - name: Build debug APK
        id: build_debug_apk
        run: ./gradlew assembleDebug --stacktrace

I tried changing Grand Gradlew Permission to chmod +x ./gradlew , changing Build debug APK to bash ./gradlew assembleDebug or ./gradlew app:assembleDebug but none of them has succeeded.


问:
"This addon could not be installed because it appears to be corrupt" Firefox Developer Edition
I already set xpinstall.signatures.required to false.
The extension loads fine in about:debugging but not in about:addons (where it matters).
The error persists regardless of whether I add the activeTab, tabs, or <all_urls> permissions.
Using Firefox Developer Edition 109.0b3 (64-bit).

Manifest:

{
  "manifest_version": 2,
  "name": "My Extension",
  "description": "Description of my extension",
  "version": "1.0",
  "icons": {
    "48": "icon.png"
  },
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["content-script.js"]
    }
  ],
  "web_accessible_resources": [
    "web-accessible-resource.html"
  ]
}
```
<p>Zipped extension:</p>
```extension.zip
├ content-script.js
├ icon.png
├ manifest.json
└ web-accessible-resource.html
```

Thanks in advance for any help.

Body:
I already set xpinstall.signatures.required to false.
The extension loads fine in about:debugging but not in about:addons (where it matters).
The error persists regardless of whether I add the activeTab, tabs, or <all_urls> permissions.
Using Firefox Developer Edition 109.0b3 (64-bit).

Manifest:

{
  "manifest_version": 2,
  "name": "My Extension",
  "description": "Description of my extension",
  "version": "1.0",
  "icons": {
    "48": "icon.png"
  },
  "content_scripts": [
    {
      "matches": ["<all_urls>"],
      "js": ["content-script.js"]
    }
  ],
  "web_accessible_resources": [
    "web-accessible-resource.html"
  ]
}

Zipped extension:

extension.zip
├ content-script.js
├ icon.png
├ manifest.json
└ web-accessible-resource.html

Thanks in advance for any help.


问:
Unable to programmatically download Kaggle dataset "nih-chest-xrays/data" specific file Version 3
I need to download Kaggle's NIH Chest X-rays Dataset programmatically, specifically the Data_Entry_2017.csv.

I want to download it if doesn't exist on system, and redownload it if it's updation date exceeds last download date.

I know I can do this manually, but I'll appreciate if there was a way to do it programmatically.

I have done:

Direct download:

kaggle.api.dataset_download_file(dataset='nih-chest-xrays/data', file_name='Data_Entry_2017.csv', path='data/')
```
<p>This gives:</p>
<pre class="lang-json prettyprint-override"><code> File "C:\Program Files\Python311\Lib\site-packages\kaggle\rest.py", line 241, in request
    raise ApiException(http_resp=r)
 kaggle.rest.ApiException: (404)
 Reason: Not Found
 HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Sun, 18 Dec
 2022 03:35:46 GMT', 'Access-Control-Allow-Credentials': 'true', 'Set-Cookie':
 'ka_sessionid=bdaa2b71c677d6e48bf93fc71b85a9c6; max-age=2626560; path=/, GCLB=CIeroe2g5sixeA;
 path=/; HttpOnly', 'Transfer-Encoding': 'chunked', 'Vary': 'Accept-Encoding', 'Turbolinks-
 Location': 'https://www.kaggle.com/api/v1/datasets/download/nih-chest-
 xrays/data/Data_Entry_2017.csv', 'X-Kaggle-MillisecondsElapsed': '526', 'X-Kaggle-RequestId':
 '03383f8cdac3aa4b6ab83d5dadbc507c', 'X-Kaggle-ApiVersion': '1.5.12', 'X-Frame-Options':
 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload',
 'Content-Security-Policy': "object-src 'none'; script-src 'nonce-gn6A4mfrbofbZRyE9gREnA=='
 'report-sample' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; frame-src 'self'
 https://www.kaggleusercontent.com https://www.youtube.com/embed/ https://polygraph-cool.github.io
 https://www.google.com/recaptcha/ https://form.jotform.com https://submit.jotform.us
 https://submit.jotformpro.com https://submit.jotform.com https://www.docdroid.com
 https://www.docdroid.net https://kaggle-static.storage.googleapis.com https://kaggle-static-
 staging.storage.googleapis.com https://kkb-dev.jupyter-proxy.kaggle.net https://kkb-
 staging.jupyter-proxy.kaggle.net https://kkb-production.jupyter-proxy.kaggle.net https://kkb-
 dev.firebaseapp.com https://kkb-staging.firebaseapp.com
 https://kkb-production.firebaseapp.com https://kaggle-metastore-test.firebaseapp.com
 https://kaggle-metastore.firebaseapp.com https://apis.google.com https://content-
 sheets.googleapis.com/ https://accounts.google.com/ https://storage.googleapis.com
 https://docs.google.com https://drive.google.com https://calendar.google.com/;
 base-uri 'none'; report-uri https://csp.withgoogle.com/csp/kaggle/20201130;", 'X-Content-Type-
 Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'Via': '1.1 google',
 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'})
 HTTP response body: b'{"code":404,"message":"Not found"}'
</code>```

Same for any other files in this dataset:

kaggle.api.dataset_download_file(dataset='nih-chest-xrays/data', file_name='test_list.txt', path='data/')
```
<p>Which again gives</p>
<pre class="lang-json prettyprint-override"><code> kaggle.rest.ApiException: (404)
 Reason: Not Found
 HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Sun, 18 Dec
 2022 03:37:20 GMT', 'Access-Control-Allow-Credentials': 'true', 'Set-Cookie':
 'ka_sessionid=b59676e67aa4a36e92657a7fa50e95f3; max-age=2626560; path=/, GCLB=CKOV0bPZ-p6ZSA;
 path=/; HttpOnly', 'Transfer-Encoding': 'chunked', 'Vary': 'Accept-Encoding', 'Turbolinks-
 Location': 'https://www.kaggle.com/api/v1/datasets/download/nih-chest-xrays/data/test_list.txt',
 'X-Kaggle-MillisecondsElapsed': '520', 'X-Kaggle-RequestId': '79fde70e368d73ba7c767a007bacc086',
 'X-Kaggle-ApiVersion': '1.5.12', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security':
 'max-age=63072000; includeSubDomains; preload', 'Content-Security-Policy': "object-src 'none';
 script-src 'nonce-U88j/npGgHfKpSCwewojZg==' 'report-sample' 'unsafe-inline' 'unsafe-eval'
 'strict-dynamic' https: http:; frame-src 'self' https://www.kaggleusercontent.com
 https://www.youtube.com/embed/ https://polygraph-cool.github.io https://www.google.com/recaptcha/
 https://form.jotform.com https://submit.jotform.us https://submit.jotformpro.com
 https://submit.jotform.com https://www.docdroid.com https://www.docdroid.net https://kaggle-
 static.storage.googleapis.com https://kaggle-static-staging.storage.googleapis.com https://kkb-
 dev.jupyter-proxy.kaggle.net https://kkb-staging.jupyter-proxy.kaggle.net https://kkb-
 production.jupyter-proxy.kaggle.net https://kkb-dev.firebaseapp.com https://kkb-
 staging.firebaseapp.com https://kkb-production.firebaseapp.com https://kaggle-metastore-
 test.firebaseapp.com https://kaggle-metastore.firebaseapp.com https://apis.google.com
 https://content-sheets.googleapis.com/ https://accounts.google.com/
 https://storage.googleapis.com https://docs.google.com https://drive.google.com
 https://calendar.google.com/; base-uri 'none'; report-uri
 https://csp.withgoogle.com/csp/kaggle/20201130;", 'X-Content-Type-Options': 'nosniff', 'Referrer-
 Policy': 'strict-origin-when-cross-origin', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443";
 ma=2592000,h3-29=":443"; ma=2592000'})
 HTTP response body: b'{"code":404,"message":"Not found"}'
</code>```

The strange thing is that I can search this dataset:

dataset_list = kaggle.api.dataset_list(search='nih')
print(dataset_list)
```
<p>Which gives:</p>
``` [nih-chest-xrays/data, nih-chest-xrays/sample, allen-institute-for-ai/CORD-19-research-challenge,
 kmader/nih-deeplesion-subset, nickuzmenkov/nih-chest-xrays-tfrecords, iarunava/cell-images-for-
 detecting-malaria, tunguz/covid19-genomes, nlm-nih/nlm-rxnorm, akhileshdkapse/nih-image-600x600-
 data, tunguz/nih-awarded-grant-text, danielmadmon/nih-xray-dataset-tfrec-with-labels,
 miracle9to9/files1, nlm-nih/rxnorm-drug-name-conventions, kmader/rsna-bone-age,
 redwankarimsony/chestxray8-dataframe, akhileshdkapse/nih-dataframe, luigisaetta/cxr-tfrec256-
 may2020, kokyew93/nihdata, ammarali32/startingpointschestx, dannellyz/cancer-incidence-totals-
 and-rates-per-us-county]
```
<p>It's literally the first one on the list.</p>
<p>And checking its metadata:</p>
<pre class="lang-py prettyprint-override"><code>dataset = vars(dataset_list[0])
print(dataset)
</code>```

Which gives:

 {'subtitleNullable': 'Over 112,000 Chest X-ray images from more than 30,000 unique patients',
 'creatorNameNullable': 'Timo Bozsolik', 'creatorUrlNullable': 'timoboz', 'totalBytesNullable':
 45096150231, 'urlNullable': 'https://www.kaggle.com/datasets/nih-chest-xrays/data',
 'licenseNameNullable': 'CC0: Public Domain', 'descriptionNullable': None, 'ownerNameNullable':
 'National Institutes of Health Chest X-Ray Dataset', 'ownerRefNullable': 'nih-chest-xrays',
 'titleNullable': 'NIH Chest X-rays', 'currentVersionNumberNullable': 3,
 'usabilityRatingNullable': 0.7352941, 'id': 5839, 'ref': 'nih-chest-xrays/data', 'subtitle':
 'Over 112,000 Chest X-ray images from more than 30,000 unique patients', 'hasSubtitle': True,
 'creatorName': 'Timo Bozsolik', 'hasCreatorName': True, 'creatorUrl': 'timoboz', 'hasCreatorUrl':
 True, 'totalBytes': 45096150231, 'hasTotalBytes': True, 'url':
 'https://www.kaggle.com/datasets/nih-chest-xrays/data', 'hasUrl': True, 'lastUpdated':
 datetime.datetime(2018, 2, 21, 20, 52, 23), 'downloadCount': 65214, 'isPrivate': False,
 'isFeatured': False, 'licenseName': 'CC0: Public Domain', 'hasLicenseName': True, 'description':
 '', 'hasDescription': False, 'ownerName': 'National Institutes of Health Chest X-Ray Dataset',
 'hasOwnerName': True, 'ownerRef': 'nih-chest-xrays', 'hasOwnerRef': True, 'kernelCount': 323,
 'title': 'NIH Chest X-rays', 'hasTitle': True, 'topicCount': 0, 'viewCount': 454490, 'voteCount':
 967, 'currentVersionNumber': 3, 'hasCurrentVersionNumber': True, 'usabilityRating': 0.7352941,
 'hasUsabilityRating': True, 'tags': [biology, health, medicine, computer science, software,
 health conditions], 'files': [], 'versions': [], 'size': '42GB'}
```
<p>I can even list the files for that dataset, and it's visible:</p>
<pre class="lang-py prettyprint-override"><code>print(kaggle.api.dataset_list_files('nih-chest-xrays/data').files)
</code>```

Which gives:

 [BBox_List_2017.csv, LOG_CHESTXRAY.pdf, ARXIV_V5_CHESTXRAY.pdf, README_CHESTXRAY.pdf,
 train_val_list.txt, Data_Entry_2017.csv, FAQ_CHESTXRAY.pdf, test_list.txt]
```
<p>A problem I noticed was that <code>kaggle.api.dataset_download_file</code> was only fetching from Version 1, where these files don't exist. This was further confirmed when I successfully fetched an image file from Version 1:</p>
<pre class="lang-py prettyprint-override"><code>res = kaggle.api.dataset_download_file(dataset='nih-chest-xrays/data', file_name='images_001/images/00000001_000.png', path='data/')
print(res)
</code>```

Which downloads the image and prints True.

My data is Version 3. Is there any way to configure kaggle to use Version 3?

Note that I can download the whole 45GB dataset, but I only require the single file Data_Entry_2017.csv.

Even more strangely, it's also throwing an error when checking its status:

print(kaggle.api.dataset_status(dataset='nih-chest-xrays/data'))
```
<p>Which gives:</p>
<pre class="lang-py prettyprint-override"><code> Traceback (most recent call last):
   File "C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets\visualise.py",
 line 117, in <module>
     full_df = load_nih_data()
               ^^^^^^^^^^^^^^^
   File "C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets\visualise.py",
 line 89, in load_nih_data
     print(kaggle.api.dataset_status(dataset='nih-chest-xrays/data'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api\kaggle_api_extended.py", line
 1135, in dataset_status
     self.datasets_status_with_http_info(owner_slug=owner_slug,
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api\kaggle_api.py", line 1910, in
 datasets_status_with_http_info
     return self.api_client.call_api(
            ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api_client.py", line 329, in call_api
     return self.__call_api(resource_path, method,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api_client.py", line 161, in
 __call_api
     response_data = self.request(
                     ^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api_client.py", line 351, in request
     return self.rest_client.GET(url,
            ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\rest.py", line 247, in GET
     return self.request("GET", url,
            ^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\rest.py", line 241, in request
     raise ApiException(http_resp=r)
 kaggle.rest.ApiException: (404)
 Reason: Not Found
 HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Sun, 18 Dec
 2022 04:14:32 GMT', 'Access-Control-Allow-Credentials': 'true', 'Set-Cookie':
 'ka_sessionid=1ab6e66561c7d9ae43ead26df25beea3; max-age=2626560; path=/, GCLB=CNS4vKLYyPuCpgE;
 path=/; HttpOnly', 'Transfer-Encoding': 'chunked', 'Vary':
 'Accept-Encoding', 'Turbolinks-Location': 'https://www.kaggle.com/api/v1/datasets/status/nih-
 chest-xrays/data', 'X-Kaggle-MillisecondsElapsed': '46', 'X-Kaggle-RequestId':
 '66473cc55f62c39d2deb0aa4cd2953a7', 'X-Kaggle-ApiVersion': '1.5.12', 'X-Frame-Options':
 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload',
 'Content-Security-Policy': "object-src 'none'; script-src 'nonce-5AJVxKPJRg4Gsi/iT3D5Aw=='
 'report-sample' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; frame-src 'self'
 https://www.kaggleusercontent.com https://www.youtube.com/embed/ https://polygraph-cool.github.io
 https://www.google.com/recaptcha/ https://form.jotform.com https://submit.jotform.us
 https://submit.jotformpro.com https://submit.jotform.com https://www.docdroid.com
 https://www.docdroid.net https://kaggle-static.storage.googleapis.com https://kaggle-static-
 staging.storage.googleapis.com https://kkb-dev.jupyter-proxy.kaggle.net https://kkb-
 staging.jupyter-proxy.kaggle.net https://kkb-production.jupyter-proxy.kaggle.net https://kkb-
 dev.firebaseapp.com https://kkb-staging.firebaseapp.com https://kkb-production.firebaseapp.com
 https://kaggle-metastore-test.firebaseapp.com https://kaggle-metastore.firebaseapp.com
 https://apis.google.com https://content-sheets.googleapis.com/ https://accounts.google.com/
 https://storage.googleapis.com https://docs.google.com https://drive.google.com
 https://calendar.google.com/; base-uri 'none'; report-uri
 https://csp.withgoogle.com/csp/kaggle/20201130;", 'X-Content-Type-Options': 'nosniff', 'Referrer-
 Policy': 'strict-origin-when-cross-origin', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443";
 ma=2592000,h3-29=":443"; ma=2592000'})
 HTTP response body: {"code":404,"message":"Not found"}
</code>```

CLI download

Check if dataset exists:

```<code>C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets>kaggle datasets list -s "nih-chest-xrays/data"
ref                                                            title                                             size  lastUpdated          downloadCount  voteCount  usabilityRating
-------------------------------------------------------------  -----------------------------------------------  -----  -------------------  -------------  ---------  ---------------
nickuzmenkov/nih-chest-xrays-tfrecords                         NIH Chest X-rays TFRecords                        11GB  2021-03-09 04:49:23           2121        119  0.9411765
nih-chest-xrays/data                                           NIH Chest X-rays                                  42GB  2018-02-21 20:52:23          65221        967  0.7352941
nih-chest-xrays/sample                                         Random Sample of NIH Chest X-ray Dataset           4GB  2017-11-23 02:58:24          14930        241  0.7647059
ammarali32/startingpointschestx                                StartingPoints-ChestX                            667MB  2021-02-27 17:35:19            668         68  0.6875
redwankarimsony/chestxray8-dataframe                           ChestX-ray8_DataFrame                             51MB  2020-07-12 02:28:33            416         10  0.64705884
amanullahasraf/covid19-pneumonia-normal-chest-xray-pa-dataset  COVID19_Pneumonia_Normal_Chest_Xray_PA_Dataset     2GB  2020-07-13 05:54:22           1482         14  0.8125
harshsoni/nih-chest-xray-tfrecords                             NIH Chest X-ray TFRecords                         42GB  2020-09-26 18:48:04             52          6  0.5294118
amanullahasraf/covid19-pneumonia-normal-chest-xraypa-dataset   COVID19_Pneumonia_Normal_Chest_Xray(PA)_Dataset    1GB  2020-06-29 08:28:01            161          3  0.5882353
roderikmogot/nih-chest-x-ray-models                            nih chest x ray models                             2GB  2022-08-17 01:32:33             66          4  0.47058824
ericspod/project-monai-2020-bootcamp-challenge-dataset         Project MONAI 2020 Bootcamp Challenge Dataset    481MB  2021-01-25 01:11:42             22          2  0.6875
sunghyunjun/nih-chest-xrays-600-jpg-dataset                    NIH Chest X-rays 600 JPG Dataset                   7GB  2021-03-15 07:53:12             35          3  0.64705884
zhuangjw/chest-xray-cleaned                                    chest_xray_cleaned                                 2GB  2019-11-30 19:05:24             13          1  0.375
kambarakun/nih-chest-xrays-trained-models                      NIH Chest X-rays: Trained Models                   3GB  2020-04-30 11:52:56             10          2  0.3125
jessevent/all-kaggle-datasets                                  Complete Kaggle Datasets Collection              390KB  2018-01-16 12:32:58           2256        118  0.8235294
vzaguskin/nih-chest-xrays-tfrecords-756                        NIH Chest X-rays tfrecords 756                    11GB  2021-02-25 14:25:12              3          1  0.29411766
</code>```

Yes, it is the second one. Now does it have my required file?

```<code>C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets>kaggle datasets files "nih-chest-xrays/data"
name                     size  creationDate
----------------------  -----  -------------------
ARXIV_V5_CHESTXRAY.pdf    9MB  2018-02-21 20:52:23
FAQ_CHESTXRAY.pdf        71KB  2018-02-21 20:52:23
Data_Entry_2017.csv       7MB  2018-02-21 20:52:23
BBox_List_2017.csv       90KB  2018-02-21 20:52:23
README_CHESTXRAY.pdf    827KB  2018-02-21 20:52:23
LOG_CHESTXRAY.pdf         4KB  2018-02-21 20:52:23
train_val_list.txt        1MB  2018-02-21 20:52:23
test_list.txt           425KB  2018-02-21 20:52:23
</code>```

Yes it does. Now download it.

```<code>C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets>kaggle datasets download -f "Data_Entry_2017.csv" -p "data/" "nih-chest-xrays/data"
404 - Not Found
</code>```

Nope, error 404.

How do I download Kaggle's NIH Chest X-rays Dataset programmatically, specifically the Data_Entry_2017.csv?

Any help is appreciated!

I have checked:

I checked out Kaggle Python API, but it doesn't appear to have any way to configure Version.

I checked out Kaggle API on github, but it also doesn't appear to have any ways to configure Version.

Related Questions Read:

Kaggle Dataset Download - is irrelevant.

Download a Kaggle Dataset - is downloading competition files.

How to download data set into Colab? Stuck with a problem, it says "401 - Unauthorized"? - They had api key issues

How to load just one chosen file of a way too large Kaggle dataset from Kaggle into Colab - Is related to kaggle and jupyter notebooks, I am currently just using a python script.

Trouble turning comorbidity data into a table using Python and Pandas - Are again using Kernels (Kaggle Notebooks).

How to download kaggle dataset? - Downloads the whole dataset.

Body:
I need to download Kaggle's NIH Chest X-rays Dataset programmatically, specifically the Data_Entry_2017.csv.

I want to download it if doesn't exist on system, and redownload it if it's updation date exceeds last download date.

I know I can do this manually, but I'll appreciate if there was a way to do it programmatically.

I have done:

Direct download:

kaggle.api.dataset_download_file(dataset='nih-chest-xrays/data', file_name='Data_Entry_2017.csv', path='data/')

This gives:

 File "C:\Program Files\Python311\Lib\site-packages\kaggle\rest.py", line 241, in request
    raise ApiException(http_resp=r)
 kaggle.rest.ApiException: (404)
 Reason: Not Found
 HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Sun, 18 Dec
 2022 03:35:46 GMT', 'Access-Control-Allow-Credentials': 'true', 'Set-Cookie':
 'ka_sessionid=bdaa2b71c677d6e48bf93fc71b85a9c6; max-age=2626560; path=/, GCLB=CIeroe2g5sixeA;
 path=/; HttpOnly', 'Transfer-Encoding': 'chunked', 'Vary': 'Accept-Encoding', 'Turbolinks-
 Location': 'https://www.kaggle.com/api/v1/datasets/download/nih-chest-
 xrays/data/Data_Entry_2017.csv', 'X-Kaggle-MillisecondsElapsed': '526', 'X-Kaggle-RequestId':
 '03383f8cdac3aa4b6ab83d5dadbc507c', 'X-Kaggle-ApiVersion': '1.5.12', 'X-Frame-Options':
 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload',
 'Content-Security-Policy': "object-src 'none'; script-src 'nonce-gn6A4mfrbofbZRyE9gREnA=='
 'report-sample' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; frame-src 'self'
 https://www.kaggleusercontent.com https://www.youtube.com/embed/ https://polygraph-cool.github.io
 https://www.google.com/recaptcha/ https://form.jotform.com https://submit.jotform.us
 https://submit.jotformpro.com https://submit.jotform.com https://www.docdroid.com
 https://www.docdroid.net https://kaggle-static.storage.googleapis.com https://kaggle-static-
 staging.storage.googleapis.com https://kkb-dev.jupyter-proxy.kaggle.net https://kkb-
 staging.jupyter-proxy.kaggle.net https://kkb-production.jupyter-proxy.kaggle.net https://kkb-
 dev.firebaseapp.com https://kkb-staging.firebaseapp.com
 https://kkb-production.firebaseapp.com https://kaggle-metastore-test.firebaseapp.com
 https://kaggle-metastore.firebaseapp.com https://apis.google.com https://content-
 sheets.googleapis.com/ https://accounts.google.com/ https://storage.googleapis.com
 https://docs.google.com https://drive.google.com https://calendar.google.com/;
 base-uri 'none'; report-uri https://csp.withgoogle.com/csp/kaggle/20201130;", 'X-Content-Type-
 Options': 'nosniff', 'Referrer-Policy': 'strict-origin-when-cross-origin', 'Via': '1.1 google',
 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000'})
 HTTP response body: b'{"code":404,"message":"Not found"}'

Same for any other files in this dataset:

kaggle.api.dataset_download_file(dataset='nih-chest-xrays/data', file_name='test_list.txt', path='data/')

Which again gives

 kaggle.rest.ApiException: (404)
 Reason: Not Found
 HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Sun, 18 Dec
 2022 03:37:20 GMT', 'Access-Control-Allow-Credentials': 'true', 'Set-Cookie':
 'ka_sessionid=b59676e67aa4a36e92657a7fa50e95f3; max-age=2626560; path=/, GCLB=CKOV0bPZ-p6ZSA;
 path=/; HttpOnly', 'Transfer-Encoding': 'chunked', 'Vary': 'Accept-Encoding', 'Turbolinks-
 Location': 'https://www.kaggle.com/api/v1/datasets/download/nih-chest-xrays/data/test_list.txt',
 'X-Kaggle-MillisecondsElapsed': '520', 'X-Kaggle-RequestId': '79fde70e368d73ba7c767a007bacc086',
 'X-Kaggle-ApiVersion': '1.5.12', 'X-Frame-Options': 'SAMEORIGIN', 'Strict-Transport-Security':
 'max-age=63072000; includeSubDomains; preload', 'Content-Security-Policy': "object-src 'none';
 script-src 'nonce-U88j/npGgHfKpSCwewojZg==' 'report-sample' 'unsafe-inline' 'unsafe-eval'
 'strict-dynamic' https: http:; frame-src 'self' https://www.kaggleusercontent.com
 https://www.youtube.com/embed/ https://polygraph-cool.github.io https://www.google.com/recaptcha/
 https://form.jotform.com https://submit.jotform.us https://submit.jotformpro.com
 https://submit.jotform.com https://www.docdroid.com https://www.docdroid.net https://kaggle-
 static.storage.googleapis.com https://kaggle-static-staging.storage.googleapis.com https://kkb-
 dev.jupyter-proxy.kaggle.net https://kkb-staging.jupyter-proxy.kaggle.net https://kkb-
 production.jupyter-proxy.kaggle.net https://kkb-dev.firebaseapp.com https://kkb-
 staging.firebaseapp.com https://kkb-production.firebaseapp.com https://kaggle-metastore-
 test.firebaseapp.com https://kaggle-metastore.firebaseapp.com https://apis.google.com
 https://content-sheets.googleapis.com/ https://accounts.google.com/
 https://storage.googleapis.com https://docs.google.com https://drive.google.com
 https://calendar.google.com/; base-uri 'none'; report-uri
 https://csp.withgoogle.com/csp/kaggle/20201130;", 'X-Content-Type-Options': 'nosniff', 'Referrer-
 Policy': 'strict-origin-when-cross-origin', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443";
 ma=2592000,h3-29=":443"; ma=2592000'})
 HTTP response body: b'{"code":404,"message":"Not found"}'

The strange thing is that I can search this dataset:

dataset_list = kaggle.api.dataset_list(search='nih')
print(dataset_list)

Which gives:

 [nih-chest-xrays/data, nih-chest-xrays/sample, allen-institute-for-ai/CORD-19-research-challenge,
 kmader/nih-deeplesion-subset, nickuzmenkov/nih-chest-xrays-tfrecords, iarunava/cell-images-for-
 detecting-malaria, tunguz/covid19-genomes, nlm-nih/nlm-rxnorm, akhileshdkapse/nih-image-600x600-
 data, tunguz/nih-awarded-grant-text, danielmadmon/nih-xray-dataset-tfrec-with-labels,
 miracle9to9/files1, nlm-nih/rxnorm-drug-name-conventions, kmader/rsna-bone-age,
 redwankarimsony/chestxray8-dataframe, akhileshdkapse/nih-dataframe, luigisaetta/cxr-tfrec256-
 may2020, kokyew93/nihdata, ammarali32/startingpointschestx, dannellyz/cancer-incidence-totals-
 and-rates-per-us-county]

It's literally the first one on the list.

And checking its metadata:

dataset = vars(dataset_list[0])
print(dataset)

Which gives:

 {'subtitleNullable': 'Over 112,000 Chest X-ray images from more than 30,000 unique patients',
 'creatorNameNullable': 'Timo Bozsolik', 'creatorUrlNullable': 'timoboz', 'totalBytesNullable':
 45096150231, 'urlNullable': 'https://www.kaggle.com/datasets/nih-chest-xrays/data',
 'licenseNameNullable': 'CC0: Public Domain', 'descriptionNullable': None, 'ownerNameNullable':
 'National Institutes of Health Chest X-Ray Dataset', 'ownerRefNullable': 'nih-chest-xrays',
 'titleNullable': 'NIH Chest X-rays', 'currentVersionNumberNullable': 3,
 'usabilityRatingNullable': 0.7352941, 'id': 5839, 'ref': 'nih-chest-xrays/data', 'subtitle':
 'Over 112,000 Chest X-ray images from more than 30,000 unique patients', 'hasSubtitle': True,
 'creatorName': 'Timo Bozsolik', 'hasCreatorName': True, 'creatorUrl': 'timoboz', 'hasCreatorUrl':
 True, 'totalBytes': 45096150231, 'hasTotalBytes': True, 'url':
 'https://www.kaggle.com/datasets/nih-chest-xrays/data', 'hasUrl': True, 'lastUpdated':
 datetime.datetime(2018, 2, 21, 20, 52, 23), 'downloadCount': 65214, 'isPrivate': False,
 'isFeatured': False, 'licenseName': 'CC0: Public Domain', 'hasLicenseName': True, 'description':
 '', 'hasDescription': False, 'ownerName': 'National Institutes of Health Chest X-Ray Dataset',
 'hasOwnerName': True, 'ownerRef': 'nih-chest-xrays', 'hasOwnerRef': True, 'kernelCount': 323,
 'title': 'NIH Chest X-rays', 'hasTitle': True, 'topicCount': 0, 'viewCount': 454490, 'voteCount':
 967, 'currentVersionNumber': 3, 'hasCurrentVersionNumber': True, 'usabilityRating': 0.7352941,
 'hasUsabilityRating': True, 'tags': [biology, health, medicine, computer science, software,
 health conditions], 'files': [], 'versions': [], 'size': '42GB'}

I can even list the files for that dataset, and it's visible:

print(kaggle.api.dataset_list_files('nih-chest-xrays/data').files)

Which gives:

 [BBox_List_2017.csv, LOG_CHESTXRAY.pdf, ARXIV_V5_CHESTXRAY.pdf, README_CHESTXRAY.pdf,
 train_val_list.txt, Data_Entry_2017.csv, FAQ_CHESTXRAY.pdf, test_list.txt]

A problem I noticed was that kaggle.api.dataset_download_file was only fetching from Version 1, where these files don't exist. This was further confirmed when I successfully fetched an image file from Version 1:

res = kaggle.api.dataset_download_file(dataset='nih-chest-xrays/data', file_name='images_001/images/00000001_000.png', path='data/')
print(res)

Which downloads the image and prints True.

My data is Version 3. Is there any way to configure kaggle to use Version 3?

Note that I can download the whole 45GB dataset, but I only require the single file Data_Entry_2017.csv.

Even more strangely, it's also throwing an error when checking its status:

print(kaggle.api.dataset_status(dataset='nih-chest-xrays/data'))

Which gives:

 Traceback (most recent call last):
   File "C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets\visualise.py",
 line 117, in <module>
     full_df = load_nih_data()
               ^^^^^^^^^^^^^^^
   File "C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets\visualise.py",
 line 89, in load_nih_data
     print(kaggle.api.dataset_status(dataset='nih-chest-xrays/data'))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api\kaggle_api_extended.py", line
 1135, in dataset_status
     self.datasets_status_with_http_info(owner_slug=owner_slug,
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api\kaggle_api.py", line 1910, in
 datasets_status_with_http_info
     return self.api_client.call_api(
            ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api_client.py", line 329, in call_api
     return self.__call_api(resource_path, method,
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api_client.py", line 161, in
 __call_api
     response_data = self.request(
                     ^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\api_client.py", line 351, in request
     return self.rest_client.GET(url,
            ^^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\rest.py", line 247, in GET
     return self.request("GET", url,
            ^^^^^^^^^^^^^^^^^^^^^^^^
   File "C:\Program Files\Python311\Lib\site-packages\kaggle\rest.py", line 241, in request
     raise ApiException(http_resp=r)
 kaggle.rest.ApiException: (404)
 Reason: Not Found
 HTTP response headers: HTTPHeaderDict({'Content-Type': 'application/json', 'Date': 'Sun, 18 Dec
 2022 04:14:32 GMT', 'Access-Control-Allow-Credentials': 'true', 'Set-Cookie':
 'ka_sessionid=1ab6e66561c7d9ae43ead26df25beea3; max-age=2626560; path=/, GCLB=CNS4vKLYyPuCpgE;
 path=/; HttpOnly', 'Transfer-Encoding': 'chunked', 'Vary':
 'Accept-Encoding', 'Turbolinks-Location': 'https://www.kaggle.com/api/v1/datasets/status/nih-
 chest-xrays/data', 'X-Kaggle-MillisecondsElapsed': '46', 'X-Kaggle-RequestId':
 '66473cc55f62c39d2deb0aa4cd2953a7', 'X-Kaggle-ApiVersion': '1.5.12', 'X-Frame-Options':
 'SAMEORIGIN', 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload',
 'Content-Security-Policy': "object-src 'none'; script-src 'nonce-5AJVxKPJRg4Gsi/iT3D5Aw=='
 'report-sample' 'unsafe-inline' 'unsafe-eval' 'strict-dynamic' https: http:; frame-src 'self'
 https://www.kaggleusercontent.com https://www.youtube.com/embed/ https://polygraph-cool.github.io
 https://www.google.com/recaptcha/ https://form.jotform.com https://submit.jotform.us
 https://submit.jotformpro.com https://submit.jotform.com https://www.docdroid.com
 https://www.docdroid.net https://kaggle-static.storage.googleapis.com https://kaggle-static-
 staging.storage.googleapis.com https://kkb-dev.jupyter-proxy.kaggle.net https://kkb-
 staging.jupyter-proxy.kaggle.net https://kkb-production.jupyter-proxy.kaggle.net https://kkb-
 dev.firebaseapp.com https://kkb-staging.firebaseapp.com https://kkb-production.firebaseapp.com
 https://kaggle-metastore-test.firebaseapp.com https://kaggle-metastore.firebaseapp.com
 https://apis.google.com https://content-sheets.googleapis.com/ https://accounts.google.com/
 https://storage.googleapis.com https://docs.google.com https://drive.google.com
 https://calendar.google.com/; base-uri 'none'; report-uri
 https://csp.withgoogle.com/csp/kaggle/20201130;", 'X-Content-Type-Options': 'nosniff', 'Referrer-
 Policy': 'strict-origin-when-cross-origin', 'Via': '1.1 google', 'Alt-Svc': 'h3=":443";
 ma=2592000,h3-29=":443"; ma=2592000'})
 HTTP response body: {"code":404,"message":"Not found"}

CLI download

Check if dataset exists:

C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets>kaggle datasets list -s "nih-chest-xrays/data"
ref                                                            title                                             size  lastUpdated          downloadCount  voteCount  usabilityRating
-------------------------------------------------------------  -----------------------------------------------  -----  -------------------  -------------  ---------  ---------------
nickuzmenkov/nih-chest-xrays-tfrecords                         NIH Chest X-rays TFRecords                        11GB  2021-03-09 04:49:23           2121        119  0.9411765
nih-chest-xrays/data                                           NIH Chest X-rays                                  42GB  2018-02-21 20:52:23          65221        967  0.7352941
nih-chest-xrays/sample                                         Random Sample of NIH Chest X-ray Dataset           4GB  2017-11-23 02:58:24          14930        241  0.7647059
ammarali32/startingpointschestx                                StartingPoints-ChestX                            667MB  2021-02-27 17:35:19            668         68  0.6875
redwankarimsony/chestxray8-dataframe                           ChestX-ray8_DataFrame                             51MB  2020-07-12 02:28:33            416         10  0.64705884
amanullahasraf/covid19-pneumonia-normal-chest-xray-pa-dataset  COVID19_Pneumonia_Normal_Chest_Xray_PA_Dataset     2GB  2020-07-13 05:54:22           1482         14  0.8125
harshsoni/nih-chest-xray-tfrecords                             NIH Chest X-ray TFRecords                         42GB  2020-09-26 18:48:04             52          6  0.5294118
amanullahasraf/covid19-pneumonia-normal-chest-xraypa-dataset   COVID19_Pneumonia_Normal_Chest_Xray(PA)_Dataset    1GB  2020-06-29 08:28:01            161          3  0.5882353
roderikmogot/nih-chest-x-ray-models                            nih chest x ray models                             2GB  2022-08-17 01:32:33             66          4  0.47058824
ericspod/project-monai-2020-bootcamp-challenge-dataset         Project MONAI 2020 Bootcamp Challenge Dataset    481MB  2021-01-25 01:11:42             22          2  0.6875
sunghyunjun/nih-chest-xrays-600-jpg-dataset                    NIH Chest X-rays 600 JPG Dataset                   7GB  2021-03-15 07:53:12             35          3  0.64705884
zhuangjw/chest-xray-cleaned                                    chest_xray_cleaned                                 2GB  2019-11-30 19:05:24             13          1  0.375
kambarakun/nih-chest-xrays-trained-models                      NIH Chest X-rays: Trained Models                   3GB  2020-04-30 11:52:56             10          2  0.3125
jessevent/all-kaggle-datasets                                  Complete Kaggle Datasets Collection              390KB  2018-01-16 12:32:58           2256        118  0.8235294
vzaguskin/nih-chest-xrays-tfrecords-756                        NIH Chest X-rays tfrecords 756                    11GB  2021-02-25 14:25:12              3          1  0.29411766

Yes, it is the second one. Now does it have my required file?

C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets>kaggle datasets files "nih-chest-xrays/data"
name                     size  creationDate
----------------------  -----  -------------------
ARXIV_V5_CHESTXRAY.pdf    9MB  2018-02-21 20:52:23
FAQ_CHESTXRAY.pdf        71KB  2018-02-21 20:52:23
Data_Entry_2017.csv       7MB  2018-02-21 20:52:23
BBox_List_2017.csv       90KB  2018-02-21 20:52:23
README_CHESTXRAY.pdf    827KB  2018-02-21 20:52:23
LOG_CHESTXRAY.pdf         4KB  2018-02-21 20:52:23
train_val_list.txt        1MB  2018-02-21 20:52:23
test_list.txt           425KB  2018-02-21 20:52:23

Yes it does. Now download it.

C:\Users\jaide\OneDrive\Documents\MScCS2022\Data-Mining-I\chest-datasets>kaggle datasets download -f "Data_Entry_2017.csv" -p "data/" "nih-chest-xrays/data"
404 - Not Found

Nope, error 404.

How do I download Kaggle's NIH Chest X-rays Dataset programmatically, specifically the Data_Entry_2017.csv?

Any help is appreciated!

I have checked:

I checked out Kaggle Python API, but it doesn't appear to have any way to configure Version.

I checked out Kaggle API on github, but it also doesn't appear to have any ways to configure Version.

Related Questions Read:

Kaggle Dataset Download - is irrelevant.

Download a Kaggle Dataset - is downloading competition files.

How to download data set into Colab? Stuck with a problem, it says "401 - Unauthorized"? - They had api key issues

How to load just one chosen file of a way too large Kaggle dataset from Kaggle into Colab - Is related to kaggle and jupyter notebooks, I am currently just using a python script.

Trouble turning comorbidity data into a table using Python and Pandas - Are again using Kernels (Kaggle Notebooks).

How to download kaggle dataset? - Downloads the whole dataset.


问:
Running old jupyter notebooks
I am trying to use a Jupyter notebook that was written by somebody else around 8 years ago. And the contents are written in Python2 and not Python3 that I am using. I am new to it and I can't figure out the reason for the syntax error.
The following are the contents of the first cells that is giving a syntax error.

```<code>`# Always run this first
# NOTE: Do not define new basic variables in this notebook;
#       define them in Variables_Q.ipynb.  Use this notebook
#       to define new expressions built from those variables.

from __future__ import division # This needs to be here, even though it's in Variables_Q.ipynb
import sys
import os
sys.path.append(os.path.join(os.path.dirname('/home/khushal/Desktop/Python/Git Repositories/PostNewtonian/PNTerms'
)) # Look for modules in directory above this one
exec(open('../Utilities/ExecNotebook.ipy').read(),{})
from ExecNotebook.ipy import execnotebook
try: execnotebook(VariablesNotebook)
except: execnotebook('Variables_Q.ipynb')`
</code>```

The error is

```<code>File "/tmp/ipykernel_31372/53020713.py", line 11
    exec(open('../Utilities/ExecNotebook.ipy').read(),{})
    ^
SyntaxError: invalid syntax

</code>```

I tried to use a 2to3 jupter notebook converter but it didn't change the jupyter notebook at all and it is giving the same result.

Title: Running old jupyter notebooks

Body:
I am trying to use a Jupyter notebook that was written by somebody else around 8 years ago. And the contents are written in Python2 and not Python3 that I am using. I am new to it and I can't figure out the reason for the syntax error.
The following are the contents of the first cells that is giving a syntax error.

`# Always run this first
# NOTE: Do not define new basic variables in this notebook;
#       define them in Variables_Q.ipynb.  Use this notebook
#       to define new expressions built from those variables.

from __future__ import division # This needs to be here, even though it's in Variables_Q.ipynb
import sys
import os
sys.path.append(os.path.join(os.path.dirname('/home/khushal/Desktop/Python/Git Repositories/PostNewtonian/PNTerms'
)) # Look for modules in directory above this one
exec(open('../Utilities/ExecNotebook.ipy').read(),{})
from ExecNotebook.ipy import execnotebook
try: execnotebook(VariablesNotebook)
except: execnotebook('Variables_Q.ipynb')`

The error is

File "/tmp/ipykernel_31372/53020713.py", line 11
    exec(open('../Utilities/ExecNotebook.ipy').read(),{})
    ^
SyntaxError: invalid syntax

I tried to use a 2to3 jupter notebook converter but it didn't change the jupyter notebook at all and it is giving the same result.


问:
Swift Combine publisher being called infinitely
Having issues figuring out why my function crashes/run indefinitely on the second run.

Function runs as expected on the first run. When i switch screens and do (onAppear) the function runs indefinitely without stopping.

Really confuse on why the logic runs perfectly as expected on first run but then indefinitely on the second run.

```<code>import Foundation
import Combine

class test: ObservableObject {
static let singleton = test()
private var disposables = Set<AnyCancellable>()
@Published var isNext = false
var logs: [Int] = []

func getfullFunctionHistory() -> AnyPublisher<[Int], Error> {
    Future<[Int], Error> { promise in
        self.$isNext.sink { completion in
            print("completion")
        } receiveValue: { bool in
            if self.logs.isEmpty {
                self.logs = [1,2,3]
            }
                if self.logs.count == 1 {
               print("done")
                    self.logs = []
            }else{
                self.logs = self.logs.dropLast(1)
               self.isNext = true
            }
        }.store(in: &self.disposables)
    }.eraseToAnyPublisher()
}
}
</code>```

view below

```<code>import SwiftUI

struct ContentView: View {
var body: some View {
    VStack {
        Button {
            test.singleton.getfullFunctionHistory()
        } label: {
            Text("Click me")
        }

    }
    .padding()
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
    ContentView()
}
}
</code>```

I'm expecting "done" to be printed only once. It prints once on the first click. Then on the second click it prints indefinitely. Second click should also print once and so on...

Body:
Having issues figuring out why my function crashes/run indefinitely on the second run.

Function runs as expected on the first run. When i switch screens and do (onAppear) the function runs indefinitely without stopping.

Really confuse on why the logic runs perfectly as expected on first run but then indefinitely on the second run.

import Foundation
import Combine

class test: ObservableObject {
static let singleton = test()
private var disposables = Set<AnyCancellable>()
@Published var isNext = false
var logs: [Int] = []

func getfullFunctionHistory() -> AnyPublisher<[Int], Error> {
    Future<[Int], Error> { promise in
        self.$isNext.sink { completion in
            print("completion")
        } receiveValue: { bool in
            if self.logs.isEmpty {
                self.logs = [1,2,3]
            }
                if self.logs.count == 1 {
               print("done")
                    self.logs = []
            }else{
                self.logs = self.logs.dropLast(1)
               self.isNext = true
            }
        }.store(in: &self.disposables)
    }.eraseToAnyPublisher()
}
}

view below

import SwiftUI

struct ContentView: View {
var body: some View {
    VStack {
        Button {
            test.singleton.getfullFunctionHistory()
        } label: {
            Text("Click me")
        }

    }
    .padding()
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
    ContentView()
}
}

I'm expecting "done" to be printed only once. It prints once on the first click. Then on the second click it prints indefinitely. Second click should also print once and so on...


问:
what is the difference between the serverless function instance and the container instance?
I'm new to serverless computing, and I have questions about serverless functions concurrency.
Some open-source serverless platforms like OpenWhisk OpenFaas deeply function using docker containers. These functions can scale up and scale down based on the invocations rate. Scaling up is achieved by increasing the number of instances. But Here, what is a function instance? Is it another container hosting the requested function? Or just another function handler inside the same container, and if so, when a container is duplicated?</p>


问:
Preserve clpfd constraint variable in findall
I'm trying to capture a constraint variable in findall. But on the other end I get independent copies of the variable:

```<code>?- X #> 1, findall(X, (true; true), Xs), X #< 100.
Xs = [_A, _B],
X in 2..99,
_B in 2..sup,
_A in 2..sup.
</code>```

By looking at the code I would expect _A = X and _B = X instead. It seems the findall machinery makes copies of the captured variable.

I can achieve the desired result by iterating over a list, but that doesn't look like an idiomatic Prolog approach:

```<code>?- X #> 1, maplist({X}/[_,R]>>(R=X), [_,_], Xs), X #< 100.
Xs = [X, X],
X in 2..99.
</code>```

Is it possible to achieve the same result with findall/clauses?

Body:
I'm trying to capture a constraint variable in findall. But on the other end I get independent copies of the variable:

?- X #> 1, findall(X, (true; true), Xs), X #< 100.
Xs = [_A, _B],
X in 2..99,
_B in 2..sup,
_A in 2..sup.

By looking at the code I would expect _A = X and _B = X instead. It seems the findall machinery makes copies of the captured variable.

I can achieve the desired result by iterating over a list, but that doesn't look like an idiomatic Prolog approach:

?- X #> 1, maplist({X}/[_,R]>>(R=X), [_,_], Xs), X #< 100.
Xs = [X, X],
X in 2..99.

Is it possible to achieve the same result with findall/clauses?


问:
How works '--checksum-seed' in rsync
I use a lot rsync for my backups.

Generally I use it with --archive and with --delete-after for do backups.

After I make the backup, I execute the same command, but with --checksum, to ensure the integrity of all copied data. With that, rsync takes a lot time 'sending incremental file list'. I suppose it's because the process of create checksum for all files is long.

Well, I read somewhere that a way to speed up the process of create checksums using '--checksum-sed' and a number, for example --checksum-seed=1234.

I try it, and it's works, the process is much more faster.

However, I don't understand how it's works. And I don't know what number I need to put as a value in --checksum-seed. Also, I'm not sure whether to use --checksum-sed is reliable.

Thanks for your time !

Not applicable for that question.

Title: How works '--checksum-seed' in rsync


问:
Cross compiling with Cargo from 64 Bit Linux to 32 Bit windows in Rust
I'm trying to cross compile a program from 64 bit Linux to 32 bit Windows.
I am already able to cross compile to x86_64-pc-windows-gnu target, but unable to cross-compile to i686-pc-windows-gnu or i686-pc-windows-msvc.

I have w64-mingw32-gcc installed. When I try to cross compile to 32 bit (i686) I get the following error:

```<code>error: linking with `i686-w64-mingw32-gcc` failed: exit status: 1
  |
  = note: "i686-w64-mingw32-gcc"

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

</code>```

I've tried

```<code>rustflags = "-C panic=abort"
</code>```

inside my .cargo/config.toml, but still always getting the same error.

The weird part is, cross compiling using crossy (cross build --target i686-pc-windows-gnu --release) works using the same host machine. Unfortunately, there are other complications with the compile-time requirements and cross being done inside a docker container that prevents me from being able to use it.

Body:
I'm trying to cross compile a program from 64 bit Linux to 32 bit Windows.
I am already able to cross compile to x86_64-pc-windows-gnu target, but unable to cross-compile to i686-pc-windows-gnu or i686-pc-windows-msvc.

I have w64-mingw32-gcc installed. When I try to cross compile to 32 bit (i686) I get the following error:

error: linking with `i686-w64-mingw32-gcc` failed: exit status: 1
  |
  = note: "i686-w64-mingw32-gcc"

  = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
  = note: use the `-l` flag to specify native libraries to link
  = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)

I've tried

rustflags = "-C panic=abort"

inside my .cargo/config.toml, but still always getting the same error.

The weird part is, cross compiling using crossy (cross build --target i686-pc-windows-gnu --release) works using the same host machine. Unfortunately, there are other complications with the compile-time requirements and cross being done inside a docker container that prevents me from being able to use it.


问:
Go Release Binaries failed
I'm trying to build my go project with github action and releasing it on my own repository. As mentioned Go Release Binaries, I wrote my own .yml file but I got error on building flow.

name: Release API binary

on:
  push:
    tags:
      - "*"

jobs:
  build:
    name: GO API build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        goos: [linux]
        goarch: [amd64, arm64]

    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@v3

      - name: Setup go and release
        uses: wangyoucao577/go-release-action@v1.34
        with:
          github_token: ${{ secrets.GITHUB_TOKEN  }}
          goos: ${{ matrix.goos }}
          goarch: ${{ matrix.goarch }}
          project_path: "./api"
          binary_name: "flying-server"

```

The project directory is like this:

-> Project root

--> api

---> main.go

---> go.mod

---> go.sum

My error on github action is just like this

Additional Note:
I tried to create a tag version with

git tag v0.0.13

then pushed it

git push origin v0.0.13

Based on the procedure above, I want to build a Go project and release it on the repository. I searched for this error, but I could not understand where the problem was.

Title: Go Release Binaries failed

Body:
I'm trying to build my go project with github action and releasing it on my own repository. As mentioned Go Release Binaries, I wrote my own .yml file but I got error on building flow.

name: Release API binary

on:
  push:
    tags:
      - "*"

jobs:
  build:
    name: GO API build
    runs-on: ubuntu-latest
    strategy:
      matrix:
        goos: [linux]
        goarch: [amd64, arm64]

    steps:
      - name: Check out code into the Go module directory
        uses: actions/checkout@v3

      - name: Setup go and release
        uses: wangyoucao577/go-release-action@v1.34
        with:
          github_token: ${{ secrets.GITHUB_TOKEN  }}
          goos: ${{ matrix.goos }}
          goarch: ${{ matrix.goarch }}
          project_path: "./api"
          binary_name: "flying-server"

The project directory is like this:

-> Project root

--> api

---> main.go

---> go.mod

---> go.sum

My error on github action is just like this

Additional Note:
I tried to create a tag version with

git tag v0.0.13

then pushed it

git push origin v0.0.13

Based on the procedure above, I want to build a Go project and release it on the repository. I searched for this error, but I could not understand where the problem was.