typescript – Im trying to goBack to the root screen on my react native app but i cant, i have a lot of errors trying different things

I want to return to th login screen or just return all like when the app is oppened, i tried to use navigation.popToTop but it drop an error like popToTop was not handled by any navigator.
The objective is just return to the login screen, its just for the logout function

import React from 'react';
import { createStackNavigator } from '@react-navigation/stack';
import MenuScreen from '../screens/MenuScreen/index'
import AddProductScreen from '../screens/AddProductScreen/AddProductScreen';
import Router from '.';
import LoginStack from './LoginStack';

const Stack = createStackNavigator();
const Root = createStackNavigator();
const NewProductStack = () => {
    return (                    
                <Stack.Screen component={MenuScreen} name="MenuScreen" options={{title:"Menú"}}/>
                <Stack.Screen component={AddProductScreen} name="AddProductScreen" options={{title:"Nuevo producto"}}/>                                    
export default NewProductStack;

Here is my stack code from my menu screen

import React from 'react'
import { View, Text, SafeAreaView, Button, StyleSheet, TouchableOpacity } from 'react-native'
import Firebase from '../../../config/firebase';
import {useNavigation, StackActions } from '@react-navigation/native';
import { AntDesign } from '@expo/vector-icons';
import { FontAwesome } from '@expo/vector-icons';
import firebase from "firebase";

const MenuScreen = () => {
    const navigation = useNavigation();        
    const onLogout=()=>{
        firebase.auth().signOut().then(() => {            
        alert('Cerrar sesión')                                
    }).catch((error) => {
            alert("No se pudo cerrar sesión")
    const newPr=()=>{
    return (
        <SafeAreaView style={styles.container}>             
             <TouchableOpacity style={styles.button} onPress={onLogout}>
             <AntDesign name="logout" size={24} color="black" />
            <Text style={styles.buttonText}>Cerrar Sesión</Text>
            <TouchableOpacity style={styles.button} onPress={newPr}>
            <FontAwesome name="money" size={24} color="black" />
            <Text style={styles.buttonText}>Vender un Producto</Text>
const styles = StyleSheet.create({
    container: {
        flex: 1,
        backgroundColor: '#fff',
        alignItems: 'baseline'        
    button: {
        borderColor: '#d3d3d3',
        borderBottomWidth: 1,
    buttonText: {
        fontSize: 20,
        fontWeight: 'bold',
        color: '#000000'        
    buttonSignup: {
        fontSize: 12
export default MenuScreen;

Here is my Menu code

import React from 'react';
import { NavigationContainer, StackActions } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';
import LoginStack from '../router/LoginStack';

const Root = createStackNavigator();

const Router = () => {
    return (
            <Root.Navigator screenOptions={{headerShown: false}}>
                <Root.Screen component={LoginStack} name="LoginStack"/>

export default Router;

Here is where I want to come

import React from 'react'
import Router from './src/router/index'
export default class App extends React.Component {
    render() {
        return <Router/>

Here is my app code

Screen showing vertical coloured lines and is not responding to touch

I have an Infinix Zero 5, and its screen has stopped working. It is just displaying multi-coloured vertical lines and is not responding to any touch. The power and volume buttons of the phone are still functional, the fingerprint scanner still works (as the display turns on when it is scanned) and the display even dims when the phone reaches the display timeout.

The phone hasn’t been dropped or anything, and the screen initially appeared after taking it out of my pocket. When I restarted the phone the first time (by holding down the power button), it started working again, but now even when restarting the phone, the display still shows these lines. I know the phone is still in working order as off and on the phone vibrates for notifications.

Is this a display issue for which I have to replace the screen or is there some other problem with the phone?

Phone with broken screen

authorization – Is a consent screen in an OAuth 2.0 implementation optional

I’ve read through RFC 6749: https://datatracker.ietf.org/doc/html/rfc6749

The only mention of consent is in this bit:

The authorization server MUST implement CSRF protection for its
authorization endpoint and ensure that a malicious client cannot
obtain authorization without the awareness and explicit consent of
the resource owner.

The above does not (to me anyway) translate to: “Hey show a consent screen with requested scopes before responding with an authorisation”.

I’ve seen so many OAuth 2.0 implementations however where a consent screen is shown.

Question 1: As per the title really – is it actually needed?

Question 2: Is there an RFC that specifies what such a consent screen (if you are to implement one) should look like, including any required messaging and response if the user declines?

linux boot error – black screen with blinking cursor – read cache enabled write cache enabled doesn’t support dpo or fua

Im new to linux. I have an old pc that used to run windows 7 ultimate. one day, while booting it froze at the loading logo. Tried many methods but didnt solve the boot problem. So i thought this would be a nice time to try out linux. I created a linux lite 5.2 64bit booable drive. I open boot menu and chose usd drive and a menu opened where i can choose to live boot, live boot safe mode, install, mem test and stuffs like that. when i live boot i got black screen with cursor. same happened when i chose to directly install it. so i chose safe mode and it booted but i cant connect to internet, the icons were large and resolution was reduced. somehow managed to install linuxlite 5.2 by formating the harddrive( it was given as an option in installation process). when i removed the usb and booted from hard dive i got the black screen with cursor blinking. SO i googled i came across a most common and frequent solution. that is to press “e” and type “nomodest” and erase ” quick splash” to see whats going on under the hood i guess. not sure what it is. when i did that, the boot process halted with this line ” read cache enabled, write cache enabled, doesn’t support dpo or fua”. i tried the nomodeset on live boot and it stopped booting at the same line. i tried different distros (ubuntu 20.04,10.04, lubuntu 16,18,20.04, linuxmint, linux lite 4.2, peppermint, lxle, fedora). I can’t even live boot in any other distros ( remember i was able to boot linux lite live in usb only in safe mode).

Hardware specs:

intel pentium dual core e5700 3ghz,

ASrock g41m-vs3

2gb ram

500gb hdd seagate

in short its a 11 year old potato pc.

whatever i do, i end with this one line and i cant find any solution.

read cache enabled, write cache enabled, doesnt support DPO or FUA.

grub menu i guess not sure

the cmd line i got when i preesed “e”

the error i got

Why does temperature disappear from At A Glance and the lock screen?

It disappeared out of the blue a few weeks ago. I searched the web and did a trick to make it reappear. It was shown for weeks and then suddenly disappeared again a few days ago.

What causes this, a bug?

why is reported screen size smaller than display size with GLFW full screen window

I’m using GLFW to create a full screen GL application. I’m running it on my Ubuntu 20.04 laptop that has a typical 1920:1080 display, at least that’s the screen resolution reported under Settings->Displays. When I run the following code:

int monitor_x = 0;
int monitor_y = 0;
int monitor_width = 0;
int monitor_height = 0;

    GLFWmonitor *monitor = glfwGetPrimaryMonitor();
    glfwGetMonitorWorkarea(monitor, &monitor_x, &monitor_y, &monitor_width, &monitor_height);
    printf("before monitor %d, %d, %d, %dn", monitor_x, monitor_y, monitor_width, monitor_height);
    window = glfwCreateWindow(1920, 1080, "OpenGL", glfwGetPrimaryMonitor(), nullptr); // Fullscreen
    glfwGetMonitorWorkarea(monitor, &monitor_x, &monitor_y, &monitor_width, &monitor_height);
    printf("after monitor %d, %d, %d, %dn", monitor_x, monitor_y, monitor_width, monitor_height);

When I run the code, get the following output on stdout:

before monitor 72, 27, 1848, 1053
after monitor 72, 27, 1848, 1053

Also, it seems as if there’s a horizontal band at the top and a vertical band at the right of the full screen that remains the background color, no matter what my application attempts to write to those areas.

So 72 + 1848 = 1920 and 27 + 1053 = 1080, but it seems that the system is reserving these horizontal and vertical bands for something else that I assume has something to do with that 72 and 27.

Is there some hint or some such thing that i need to specify in order to make the entire 1920 by 1080 of the screen available for rendering?


adb – PIN locked Pixel with broken screen and USB debugging OFF, OTG keyboard doesn’t unlock it

I got a Google Pixel 1 with a smashed dead black screen locked by a known PIN that I would like to recover some photos from. Nothing vital but now it has become a personal crusade to do it!

The good news are:

  • it shows as MTP device on win/linux
  • vibrates if I try to unlock it via fingerprint (as it requires PIN, so no can do)
  • if I connect a keyboard/mouse via OTG they do light up
  • in recovery mode it shows in ADB and I’m even able to put it into sideload mode

The bad news:

  • can’t see sh1t (BTW Pixel 1 doesn’t support USB-C -> HDMI)
  • USB debugging is OFF
  • if I enter my PIN via OTG+keyboard then plug it back to the PC, it stills shows as MTP and no files can be browsed (I would assumes it remains locked)

I’m pretty close to burn another 20 bucks and get a second spare screen but before I do that, any ideas?
From what I read, my greatest achievement so far which was to get it in sideload blindly is useless and every 3rd party tool seems to require USB debugging ON.


Touch Screen Monitor

Does anyone here use a touch screen monitor for your PC?

I considered getting one at some point but then changed my mind and that’s probably because of cost!

python – Pygame End Screen Problem How To Fix?

Video as you can see there I am trying to make my end screen restart my game but whats happening is that its not restarting my game its just loading the same thing when I die >> how could I make it so it restarts my game when I click start game on my end screen?

my end screen def


def button(msg,x,y,w,h,ic,ac,action=None):
    mouse = pygame.mouse.get_pos()
    click = pygame.mouse.get_pressed()

    if x+w > mouse(0) > x and y+h > mouse(1) > y:
        pygame.draw.rect(window, ac,(x,y,w,h))
        if click(0) == 1 and action != None:
        pygame.draw.rect(window, ic,(x,y,w,h))
    smallText = pygame.font.SysFont("comicsansms",20)
    textSurf, textRect = text_objects(msg, smallText)
    textRect.center = ( (x+(w/2)), (y+(h/2)) )
    window.blit(textSurf, textRect)


def text_objects(text, font):
    textSurface = font.render(text, True, black)
    return textSurface, textSurface.get_rect()

def endScreen():
    red = (200,0,0)
    green = (0,200,0)
    bright_red = (255,0,0)
    bright_green = (0,255,0)

    intro = True
    while intro:
        for event in pygame.event.get():
            if event.type == pygame.QUIT:

        largeText = pygame.font.Font('BLOODY.ttf',100)
        TextSurf, TextRect = text_objects("You Have Died Fool", largeText)
        TextRect.center = ((800/2), (800/2))
        window.blit(TextSurf, TextRect)
        button("Start Game",150,450,100,50,green,bright_green,game_loop)

# make the square brighter if collideded with the buttons
        mouse = pygame.mouse.get_pos()
        if 150+120 > mouse(0) > 150 and 450+50 > mouse(1) > 450:
            pygame.draw.rect(window, bright_green,(150,450,120,50))
            pygame.draw.rect(window, green,(150,450,120,50))
        if 550+110 > mouse(0) > 550 and 450+50 > mouse(1) > 450:
            pygame.draw.rect(window, bright_red,(550,450,110,50))
            pygame.draw.rect(window, red,(550,450,110,50))
# ---------------------------------------------------------------------

        smallText = pygame.font.Font("freesansbold.ttf",20)
        textSurf, textRect = text_objects("Start Game", smallText)
        textRect.center = ( (150+(120/2)), (450+(50/2)) )
        window.blit(textSurf, textRect)

        smallText = pygame.font.Font("freesansbold.ttf",20)
        textSurf, textRect = text_objects("Quit Game", smallText)
        textRect.center = ( (150+(910/2)), (450+(50/2)) )
        window.blit(textSurf, textRect)



and on my main loop I said if my playerman health is > -1 it should load the end screen

            if playerman.health < -5: