google play store – Uninstall system apps on rooted android 10

I’ve been trying to remove the chrome, youtube and playstore applications from my android device, however, I’ve run into some issues. I’ve tried rooting my device, but the systems folder is hard-coded as read-only on android 10, so I’ve not been able to permanently change build.prop or directly uninstall any of these apps. My current workaround has been to remove these apps from my user profile and disable the multiuser feature using the ADB tool. However, when I restart my device, the feature reenables itself. Does anyone know of a better way to approach this problem?

Edit: I’ve rooted my phone using magisk. Apps like titanium backup have not been able to uninstall these apps.

This is the code that I’ve used to disable the multisuser feature:
setprop fw.show_multiuserui 0
setprop fw.max_users 1

web video from archive.org does not play

I have android 9 box with Chrome and Firefox installed. Usually if video does not play in one browser, it does play in another, youtube works in both. However, videos from archive.org do not play, one can select an episode, but when one clicks on white triangle to play nothing happens. I can play on laptop, there if I Cntrl+click on the video it says JW Player 8.8.2. I am new to android, how to fix/troubleshoot?

I cant reinstall google play services

(I am writing this from my school computer) My question is about how to reinstall google play services…

I cant seem to reinstall google play services again! I tried the APK file thingy from google but…IT DIDN’T WORK! I tried a website called APKPure.com but it also didn’t work… I also tried some videos but those are for different models of devices! I didn’t know that google play services plays a big role for a android and now…I cant even sign in into my play store account (The sign in button for the play store isn’t working)! Also, if this helps…..I use a Samsung Galaxy Tab 2. (I think it is a 2016 model) PLEASE HELP ME I HAVE A YOUTUBE CHANNEL AND I DON’T WANT TO LOSE IT!!! For now, i’m using a guest account to continue my YouTube channel but I don’t have enough storage space! (My YouTube channel is Glitterpuf and I only have 63 subscribers!) PLEASE is there a way to fix this problem??? Please answer this question as soon as possible since I AM DESPERATE!!!

python – I want to a generic algorithm to play TicTacToe. It keeps stagnating at a point where it loses games. Why doesn’t it advance further?

The AI is built with neat-python. The input is the gameboard as a list of fields (0:unoccupied, 1:player1, 2:player2). The AI produces 9 outputs and the index of the max(output) gets chosen as field to go. It trains against a bot who chooses fields randomly. If the field to go is already occupied, the first free field is being set as field to go.

import neat
import pygame
import os
import json
import random
import checkpoint
import winsound
import time
import matplotlib.pyplot as plt

pygame.init()
cloud = checkpoint.Checkpointer()
p = None
GEN = 0
screen = None
pygame.display.set_caption("Tic Tac Toe")
o_icon = pygame.image.load("o.png")
x_icon = pygame.image.load("x.png")

class Field:
    def __init__(self):
        self.field = (0,0,0, 0,0,0, 0,0,0)
        self.winner = None

    def reset(self):
        self.field = (0,0,0, 0,0,0, 0,0,0)
        self.winner = None

    def display(self):
        screen.fill((0,0,0))
        self.display_pieces()
        self.display_board()
        pygame.display.update()

    def display_pieces(self):
        pos_to_pix = {
            0: (0,0),
            1: (100,0),
            2: (200,0),
            3: (0,100),
            4: (100,100),
            5: (200,100),
            6: (0, 200),
            7: (100, 200),
            8: (200, 200)
        }
        for pos in range(len(self.field)):
            if self.field(pos) == 1:
                screen.blit(x_icon, pos_to_pix(pos))
            elif self.field(pos) == 2:
                screen.blit(o_icon, pos_to_pix(pos))

    @staticmethod
    def pos_to_field(pos):
        x = pos(0)
        y = pos(1)
        if x < 100:
            x = 0
        elif x < 200:
            x = 1
        else:
            x = 2
        if y < 100:
            y = 0
        elif y < 200:
            y = 1
        else:
            y = 2
        return x+y*3

    @staticmethod
    def display_board():
        pygame.draw.rect(screen, "White", (0,99, 300,2))
        pygame.draw.rect(screen, "White", (0,199, 300,2))
        pygame.draw.rect(screen, "White", (99,0, 2,300))
        pygame.draw.rect(screen, "White", (199,0, 2,300))

    def action(self, field_id, player_id):
        self.field(field_id) = player_id

    def field_is_free(self, field):
        if self.field(field) == 0:
            return True
        return False

    def check_winner(self):
        for line in range(3):
            # check horizontal
            if self.field(line*3) == self.field(line*3+1) == self.field(line*3+2) != 0:
                self.winner = self.field(line*3)
                return True, self.winner
            if self.field(line) == self.field(line+3) == self.field(line+6) != 0:
                self.winner = self.field(line)
                return True, self.winner
        if self.field(0) == self.field(4) == self.field(8) != 0:
            self.winner = self.field(0)
            return True, self.winner
        if self.field(2) == self.field(4) == self.field(6) != 0:
            self.winner = self.field(2)
            return True, self.winner
        return False

    def first_free(self):
        for index, value in enumerate(self.field):
            if value == 0:
                return index

class Player:
    def __init__(self, id, being, brain=None):
        self.id = id
        self.being = being
        self.brain = brain

class Graph:
    def __init__(self):
        self.gens = ()
        self.maxs = ()
        self.losts = ()
        self.drawns = ()
        self.wons = ()
        self.average = ()
        self.last_gens = 50
        self.vmax = None

    def add(self, gen, vmax_round, lost, drawn, won):
        self.gens.append(gen)
        self.maxs.append(vmax_round)
        self.losts.append(lost)
        self.drawns.append(drawn)
        self.wons.append(won)
        self.average.append(sum(self.maxs(-min(self.last_gens,gen):)) / min(self.last_gens,gen))
        self.vmax = max(self.maxs)

    def display(self):
        plt.figure(figsize=(10,6))
        plt.plot(self.gens, self.maxs, label="Best Fitness")
        plt.plot(self.gens, self.average, label="Average Fitness last " + str(self.last_gens) + " generations")
        plt.plot(self.gens, self.losts,  label="Lost")
        plt.plot(self.gens, self.drawns,  label="Drawn")
        plt.plot(self.gens, self.wons,  label="Won")
        plt.legend(bbox_to_anchor=(1.05, 1), loc="upper left")
        plt.grid("on")
        plt.tight_layout()
        plt.show()

    def save(self):
        with open('gens.txt', 'w') as filehandle:
            json.dump(self.gens, filehandle)
        with open('maxs.txt', 'w') as filehandle:
            json.dump(self.maxs, filehandle)
        with open('average.txt', 'w') as filehandle:
            json.dump(self.average, filehandle)
        with open('losts.txt', 'w') as filehandle:
            json.dump(self.losts, filehandle)
        with open('drawns.txt', 'w') as filehandle:
            json.dump(self.drawns, filehandle)
        with open('wons.txt', 'w') as filehandle:
            json.dump(self.wons, filehandle)

    def load(self):
        with open('gens.txt', 'r') as filehandle:
            self.gens = json.load(filehandle)
        with open('maxs.txt', 'r') as filehandle:
            self.maxs = json.load(filehandle)
        with open('average.txt', 'r') as filehandle:
            self.average = json.load(filehandle)
        with open('losts.txt', 'r') as filehandle:
            self.losts = json.load(filehandle)
        with open('drawns.txt', 'r') as filehandle:
            self.drawns = json.load(filehandle)
        with open('wons.txt', 'r') as filehandle:
            self.wons = json.load(filehandle)

graph = Graph()
board = Field()

def place_piece(player, field):
    board.field(field) = player.id

def sound():
    winsound.Beep(440,200)

def train(genomes, config):
    global GEN
    GEN += 1
    best_fitness = 0
    players = (None, None)
    best_lost, best_drawn, best_won = 0,0,0

    for index, genome in genomes:
        index -= 1
        genome.fitness = 0
        net = neat.nn.FeedForwardNetwork.create(genome, config)

        players(0) = Player(1, "random")
        players(1) = Player(2, "ai")
        lost, drawn, won = 0,0,0

        for round in range(100):
            if round == 50:
                players(0) = Player(1, "ai")
                players(1) = Player(2, "random")

            field_to_go = -1
            placed = 0
            player = players(0)

            while True:
                if player.being == "random":
                    field_to_go = random.randint(0,8)
                elif player.being == "ai":
                    output = net.activate(board.field)
                    field_to_go = output.index(max(output))
                elif player.being == "human":
                    for event in pygame.event.get():
                        if event.type == pygame.QUIT:
                            pygame.quit()
                            break
                        elif event.type == pygame.MOUSEBUTTONUP:
                            field_to_go = board.pos_to_field(pygame.mouse.get_pos())

                if field_to_go > -1:
                    if board.field_is_free(field_to_go):
                        board.action(field_to_go, player.id)
                    else:
                        board.action(board.first_free(), player.id)

                    if player == players(0):
                        player = players(1)
                    else:
                        player = players(0)
                    placed += 1

                if shown:
                    board.display()
                    time.sleep(1)

                if board.check_winner() or placed == 9:
                    if board.winner is None:
                        genome.fitness += 1
                        drawn += 1
                    elif players(board.winner-1).being == "ai":
                        genome.fitness += 2
                        won += 1
                    else:
                        genome.fitness -= 0
                        lost += 1
                    board.reset()
                    break
        if genome.fitness > best_fitness:
            best_fitness = genome.fitness
            best_lost = lost
            best_drawn = drawn
            best_won = won
    graph.add(GEN, best_fitness, best_lost, best_drawn, best_won)

def test(genome):
    result = (0,0,0)
    players = (None, None)
    for round in range(1000):
        placed = 0
        if round % 2 == 0:
            players(0) = Player(1, "ai")
            players(1) = Player(2, "human")
        else:
            players(0) = Player(1, "human")
            players(1) = Player(2, "ai")

        player = players(0)
        while True:
            field_to_go = -1
            if player.being == "random":
                field_to_go = random.randint(0,8)
            elif player.being == "ai":
                output = genome.activate(board.field)
                field_to_go = output.index(max(output))
            elif player.being == "human":
                for event in pygame.event.get():
                    if event.type == pygame.QUIT:
                        pygame.quit()
                        break
                    elif event.type == pygame.MOUSEBUTTONUP:
                        field_to_go = board.pos_to_field(pygame.mouse.get_pos())

            if field_to_go > -1:
                if board.field_is_free(field_to_go):
                    board.action(field_to_go, player.id)
                else:
                    board.action(board.first_free(), player.id)
                if player == players(0):
                    player = players(1)
                else:
                    player = players(0)
                placed += 1

            if shown:
                pygame.event.get()
                board.display()
                time.sleep(0.75)

            if board.check_winner() or placed == 9:
                if board.winner is None:
                    result(1) += 1
                elif players(board.winner-1).being == "ai":
                    result(2) += 1
                else:
                    result(0) += 1
                if shown:
                    if board.winner is None:
                        print("None")
                    else:
                        print(players(board.winner-1).being + " " + str(player.id))
                board.reset()
                break
    print(result)

def run(config_path):
    global shown
    global GEN
    global screen
    config = neat.config.Config(neat.DefaultGenome, neat.DefaultReproduction,
                                neat.DefaultSpeciesSet, neat.DefaultStagnation, config_path)
    nc_name = "population"

    testing = False
    shown = False
    new = True

    if testing:
        if shown:
            screen = pygame.display.set_mode((300, 300))
            pygame.display.set_caption("Tic Tac Toe")
        test(neat.nn.FeedForwardNetwork.create(cloud.restore_checkpoint("population").population.best_genome, config))
        quit()

    if new:
        p = neat.Population(config)
        p.add_reporter(neat.StdOutReporter(True))
        p.add_reporter(neat.StatisticsReporter())
    else:
        p = cloud.restore_checkpoint(nc_name).population
        graph.load()
    GEN = p.generation
    p.run(train,250)
    print(time.strftime("%H:%M:%S", time.localtime()))
    cloud.save_checkpoint(config, p, p.species, GEN, nc_name)
    graph.save()
    graph.display()
    sound()

if __name__ == "__main__":
    local_dir = os.path.dirname(__file__)
    config_path = os.path.join(local_dir, "config_feedforward")
    run(config_path)

After 100 games the AI gets relatively fast to a score of 175. But it does not enhance from that point on. And still loses games what doesn’t happen when you play perfect. What am I doing wrong? Thanks for your help 🙂

enter image description here

Download is paused on Play Store when closed in the background

Downloading apps on my new Vivo Y30, whenever I try to download to an app, I have to keep Play Store running on the background. When I try to close, my download pauses. It only resumes when I open the app again. I just want to close background process to avoid having slow performance when using my phone. Any answers will be accepted.

applications – How to play CACHE Audio files ? How do I convert them to mp3 files?

I have a music streaming app that can download music. I checked the directory of the app in Internal Storage. It has got audio files for the songs I had downloaded but in CACHE format.
I would like to know how can I play those CACHE files on a different device say my PC? How can I convert CACHE audio to mp3 ?

I have tried changing the extension to mp3 (This method presently works with .xoht files of music) but here it make the audio corrupted.

I searched the net for conversion of CACHE to mp3 but have got a result on a site that converting CACHE files is not possible. SRC: https://www.lifewire.com/cache-file-2620119

dnd 5e – How can I convince new players to read and learn the basic rules before sitting down to play?

Treat this as an opportunity to grow together as a group.

While you are the only experienced player, you will be learning D&D 5e as a group. Together. That can be a lot of fun. I strongly suggest that you let go of your instincts and assumptions from your last edition. Treat this like a new game. It will help a lot. This is from personal experience. It took me getting this advice from another player to finally begin to enjoy this edition: that (letting go) was hard for me to do, as I’d DM’d a lot starting from the late 70’s …

Learning by doing isn’t all bad

Your player who thinks that ‘learning by doing’ is a good path ahead isn’t all wrong; you need to dream up an adventure anyway, so why not start with a very basic one?

First, make up three simple encounters; one mostly social(bandits or thugs threatening someone in a town), one mostly combat(wolves), and one that could go either way (more bandits or perhaps a few cultists).

Second, have some exploration and a couple of encounters in a two level “ruined tower on the outskirts of town.” (A few miles away)

  • Room 1, entry way, abandoned tower, describe its decrepit
    condition. Room 2, either have a door or a secret door or an arch to
    enter it. Something in there, if only a few rotting skeletons.
    Spider webs on the stairs going up. Room 3, Giant Spider. Room 4:
    something special; a captive, a book, a chest with some silver coins
    and an emerald on a necklace, a healing potion, a map to a cave with
    treasure, or, the cult leader. Something. A trap door to the roof
    and a ladder allows you to add a third floor if you like.

    enter image description here

Your players will meet, start in town, have a few encounters, and then for ‘a reason’ they head out of town for the tower.

Remember, these are new players. Keeping it simple is important.

  1. For the first session, don’t have them roll up characters. Go to WoTC web site and pick 5 or 6 pre-generated PCs of first level. Make each one a different class. I recommend these:
    Fighter, Rogue, Wizard, Cleric, Barbarian, Monk
    Pregenerated Character sheets.

    Have them printed out, lying on the table, and ready to choose.

    Have all of your players roll a die (use a d12 or a d20. Ties re-roll until one has a higher score). Highest roll gets first pick, and in descending order they pick a character that appeals to them. Put any left over characters aside. (If the players end up negotiating with each other “Hey, I was hoping for that barbarian, can we trade?” don’t get in the way of that. Let them figure that out).

  2. Explain how the basics of the rules go:

    How to Play
    The play of the Dungeons & Dragons game unfolds according to this basic pattern.

    1. The DM describes the environment.
    2. The players describe what they want to do.
    3. The DM narrates the results of the adventurers’ actions.

    Then, simply start playing. Situate them in a town, and tell them what they see and what they encounter. Ask them what they do, or what they try to do. Make sure that you ask each player. Have them explain to you in plain language, and then you translate that into game play.
    I can’t stress this next part enough:

  3. Only refer to the PC character sheet if they need to look something up, otherwise, ignore the character sheet.

    Focus on the “theater of the mind” in terms of what they are encountering. Use visual aids if you have them, but a pencil and a piece of paper to sketch, or a white board with a dry erase marker, will suffice.

  4. Roll the dice as rarely as possible. Granted, there will be ample die rolling ion combat, but otherwise keep it to a minimum.

    If you are not sure about a roll or a rule, err in favor of the players.

The above method is how I got a bunch of pre-teens playing Basic D&D in the early 00’s. (Black box, 25th anniversary edition). They had fun. They came back for more. And their parents didn’t object, despite living in a part of the country where “D&D is the devil’s game” was not uncommon to run into.

What happened was that as a mechanical thing arose in play, I simply adjudicated the action, told them what to roll, and explained it later.

Example

A giant spider in the tower’s second floor bites the Rogue and scores a hit. If you want to embellish on this hit, you can describe the feeling of the poison entering their veins, burning, but tell the Rogue player this:
“Roll a d20, this is a Constitution saving throw.”

They roll.
Ask the Rogue: “What is your bonus for Constitution?”
Rogue reads off of the sheet: “It’s a +1” 1
“Add 1 to the roll. Is it greater that 12?”
Yes or no, apply the poison or don’t, and then keep on playing.

Keep the pace of play moving!

You are all, as a group, learning the game together.

Bottom line: you have a great opportunity to establish some good habits early. Don’t miss it.

Caveat 1: make sure you understand the action economy. Focus on move, action, and interaction. Apply bonus action or reaction only when it comes up. Part of your role as DM is as a coach; I still do this, coaching, when I DM. Be alert for reaction or bonus actions arising, and apply them in play so that the players see what those are as they learn how to play. (In re coaching as DM, Tim Grant’s answer is superb detail on that. Please read it).

Caveat 2: make sure that you understand what the first level spells do; the spells that are on the pre gen sheets. That way, if they are thinking of casting a spell, you can be of assistance. Spell casters are a bit more labor intensive for new players than martial characters.

Caveat 3: make sure that the first time one of them gets knocked to 0 HP, tell them “You are not dead yet!” They get to roll death saving throws, other players can help, etc.

Once the first session is over, talk about how it went with the group

If they like it, you can then discuss rolling up their own characters, or keep on playing with these ones, or picking some of the other pregens.

Credit where credit is due: this answer is a variation on “how to get people to not focus on the rules” answer here. The guy who wrote that answer developed Basic / Expert / Companion / Master / Immortal (BECMI) D&D in the early 1980’s. What he describes there is a lot like some of the sessions I used to run for new players, from pre teen through adults in their 40s, for about 20 years as a DM.


1 Or, it goes like this (thanks @TimGrant)
DM asks Rogue: “What is your bonus for Constitution?”
Rogue: “13”
DM says: “That sounds like your ability score. Your bonus would be a smaller number. It would either be zero, or start with a plus or minus. Look for where it says ‘plus one.’”
Rogue: “Oh, it’s +6”
DM: Proceeds to explain how ability score bonuses work, and points to the page in PHB/Basic Rules where that is explained …

google play services – help, my android keeps on doing something weird

Whenever I sign in, my phone keeps on spamming a popup message saying “google play services keeps on stopping” and I seemingly cant do anything about it. I’ve tried shutting my phone down, restarting it, and turning it off and on, but none of these have worked. anyone know how to fix this?

lua – Play and Pause State

Problem

i want to implement a pause state and with a simple conditional inside the update of PlayState is very very simple.
However i think that the pause has to be another state in the StateMachine so i dont know how to call that PauseState and then resume the Play State without calling the init again, i mean, i dont want to start the PlayState from zero

Code

Main

 gStateMachine = StateMachine {
        ('title') = function() return TitleScreenState() end,
        ('countdown') = function() return CountdownState() end,
        ('play') = function() return PlayState() end,
        ('score') = function() return ScoreState() end,
        ('pause') = function() return PauseState() end,
    }
    gStateMachine:change('title')

StateMachine

function StateMachine:init(states)
    self.empty = {
        render = function() end,
        update = function() end,
        enter = function() end,
        exit = function() end
    }
    self.states = states or {} -- (name) -> (function that returns states)
    self.current = self.empty
end

function StateMachine:change(stateName, enterParams)
    assert(self.states(stateName)) -- state must exist!
    self.current:exit()
    self.current = self.states(stateName)()
    self.current:enter(enterParams)
end

PlaysState

 if love.keyboard.wasPressed('p') then
        self.paused = not self.paused //Here i pause the game
    end

Resume

Basically I want to make it more pro, and I understand that the correct way to do it according to the design patterns of video games is to incorporate a GameState that is PauseState.

My problem as I was telling you before is that when I make a change state from PlayState to PauseState, and then return to PlayState, the PlayState:init is called again, and I simply want its update not to be called and then resume correctly.

What I want to do is correct ?, Is there any way to do it right ?, I imagine something like stacking the States then Push and Pull them, but I do not know if it is correct