builds – “app not installed” error on installing rebuild recompiled resigned after editing modifying app manifest through Apk editor?

How to solve “app not installed” error on installing rebuild recompiled resigned after editing modifying app manifest through Apk editor for changing Android storage location?

I was trying to edit manifest installLocation=”preferExternal” I tried with to modify apk manifest of installed app through apk editor app from apk editor apps comman edit option menu it worked successfully with many apps it recompiled rebuild and resigned and then I unistalled installed and moved the app it worked great and made unmovable apps movable

But some of the user apps apk mainfest edited changed builded signed properly but after uninstalling and reinstalling recompiled rebuilds resigned apps again it gave error “app not.installed ” out of 10 apps I edited modified it didn’t worked for 3 apps but 7 it worked installed perfectly.

I saw some video on YouTube they resigned the file recompiled rebuild file by all editor with zip signer app or apksigner app I tried with Both but still same error

Is there any other parameters to be changed in manifest to resolve the problem.Or its not possible to rebuild edit with some other apps.

Is there alternative apps like apk editor which modifies edits apk mainfest and auto decompile compile builds signs automatically .

Any solution suggestion advice for solving the problem

editor – Edit Post with a parameter in URL

I was thinking in a way to make the editors have a quick way to access the current post editor.

I know we can manage this by showing a Link and make some conditionals to show to some users and login in users, but it would be cool to have something like this.

I thought first in something like:

add_action('init', 'edit_post_please');
function edit_post_please()
{
    if (is_user_logged_in() && current_user_can( 'edit_posts' )) {
        $protocol = ((!empty($_SERVER('HTTPS')) && $_SERVER('HTTPS') != 'off') || $_SERVER('SERVER_PORT') == 443) ? "https://" : "http://";
        $url = $protocol . $_SERVER('HTTP_HOST') . $_SERVER('REQUEST_URI');
    
        $id = url_to_postid($url);


        $parts = explode("/", $url);
        $editor = end($parts);
        $editor_link = get_edit_post_link($id);

        if ($editor == '?editor') {
            wp_redirect($editor_link);
            exit;
        }
    }
}

I haven’t think about the security issues or anything else this code does’t seem to work at all, I mean it redirects well to Dashboard but not to post I would like to edit.

$editor_link have the correct edit url, but seems that this could be a restriction of WP?

theme development – How to Add Custom Button to Text(HTML) Editor and NOT Visual Editor

I followed this tutorial which is adding a custom button into Visual Editor as it is supposed to. But this is not adding the button into the Text(HTML) Editor. Can you please let me know how I can add my own button into Text(HTML) Editor only (or at least both! and not Visual one)

function enqueue_plugin_scripts($plugin_array)
{
    //enqueue TinyMCE plugin script with its ID.
    $plugin_array("green_button_plugin") =  plugin_dir_url(__FILE__) . "index.js";
    return $plugin_array;
}

add_filter("mce_external_plugins", "enqueue_plugin_scripts");

function register_buttons_editor($buttons)
{
    //register buttons with their id.
    array_push($buttons, "green");
    return $buttons;
}

add_filter("mce_buttons", "register_buttons_editor");

Não consigo colocar imagens grandes no componente text editor do primefaces

estava testando esse componente do primefaces
https://primefaces.github.io/primefaces/10_0_0/#/components/texteditor
eu imprimia o conteudo dentro do componente, quando escrevia qualquer texto ele imprimia bem mas quando anexava uma imagem ele não imprimia nada, o curioso é que com imagens menor que 28KB funcionava aparecia a tag eu estou usando o servidor payara 5
agradeço desde ja

Unity Input: Thumbstick works in editor, not in WebGL

Well, I was unable to reproduce the problem using Unity 2020.3.11f1 and my own gamepad (Cheap XBox 360 compatible gamepad by Speedlink).

I used the Input Manager to create 7 axis inputs and mapped them to the Joystick axis
X, Y, 3, 4, 5, 6 and 7 “from all Joysticks”. I then created a script to visualize those 7 axis’ on the canvas.

The result behaves the same way for me in both the editor and the WebGL build, the latter both in Firefox and in Edge. I uploaded the result to itch.io so you can check it yourself.

Those axis map to my gamepad as follows:

  1. Left Thumbstick Horizontal
  2. Left Thumbstick Vertical
  3. Triggers
  4. Right Thumbstick Horizontal
  5. Right Thumbstick Vertical
  6. D-Pad Horizontal
  7. D-Pad Vertical

Note that not all gamepads will map the same way. This is one of many input device compatibility problems the new Input System available in Unity 2019+ solves. When you don’t want to migrate to the new input system, then the best workaround is to let the player configure their input axis` themselves.

When it does work as well for you as it works for me, then I recommend you to update your project to a more recent version of Unity. I can’t tell you how recent you have to go, so when you don’t want to go all the way to 2020, then you have to find the minimum required version yourself using trial and error.

visual editor – Stop removing whitespace in markdown code blocks?

I want to store my posts in plaintext markdown instead of HTML. I have started by following Store post in raw markdown format, no html?, and as a result I do get what seems like a plain text box as my editor. However, when I hit update, the spaces that I indent code blocks with are being removed (as described here).

With trial and error, I concluded that when I remove the recommended add_filter( 'user_can_richedit', '__return_false', 50 ), the spaces are no longer removed (while yes, I do revert back to the rich editor – which contradicts the whole markdown idea).

I found several solutions that don’t work for me (or at all):

text editor – What could be possible reasons for shortcut conflicts in IDE’s?

I would like to know why are there conflicting shortcuts in any given closed-source(or open-source for that matter) IDE although the IDE would have Predefined keymaps to match the users’ operating system or the previous IDE/text editor.

I would expect any given IDE to have 0 shortcut conflicts. Why can’t the IDE’s match the vanilla OS shortcuts’ keymaps. Matching the IDE shortcuts with only the latest OS shortcuts would also sound reasonable.

I’ve tried to look up answers to why are these shortcut conflicts still a thing on a closed-source IDE but without luck. Is it some technical blocker that I’m not aware of? If so why doesn’t this show in any of the IDE’s documentation?

n.b. Like a sophisticated stack post this one is looking for answers or reasoned speculations not opinions.

How to run PowerShell command from SharePoint Script Editor?

I want to run PowerShell command (any command) from SharePoint Script Editor.

Please let me know how can I achieve it?

I use the below script to lunch notepad, just to test it, and even it doesn’t work:

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js" type="text/javascript"></script>

<script language="javascript" type="text/javascript">

function LaunchApp() {
   var shell = new ActiveXObject("WScript.shell");
   shell.run("notepad.exe", 1, True);
};

</script>
<button type="button" id="btn" onclick=LaunchApp()>Run App</button>

Please help.

unity – Pathfinding Only Working in Editor View

I am new to the a* method so still learning. I have two scripts, a Pathfinding script and a GridForPathfinding script. When I am not in the Editor view or looking at the DrawGizmos during play, the Pathfinding script is unable to find the path and I cannot figure out why. I think at this point I have been looking at this for so long and hoping it’s just something simple I am overlooking. It has something do with the DrawGizmos, but I am not sure why since it is just reading the path node list.

GridForPathfinding script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class GridForPathfinding : MonoBehaviour
{
public static GridForPathfinding instance;
public List<Node> path;
public bool onlyDisplayPath;
private Node(,) grid;

private Vector2 gridWorldSize;
public float nodeRadius;
public float nodeDiameter;
private int gridSizeX, gridSizeY;
public LayerMask unWalkableMask;

private void Awake()
{
      instance = this;
}


private void OnDrawGizmos()
{
    gridWorldSize.x = Maze.instance.iSize.x;
    gridWorldSize.y = Maze.instance.iSize.z;
    Gizmos.DrawWireCube(Vector3.zero, new Vector3(gridWorldSize.x, 1, gridWorldSize.y));

    if (onlyDisplayPath)
    {
        if(path != null)
        {
            foreach(Node n in path)
            {
                Gizmos.color = new Color(0, 1, 0, 0.5f);
                Gizmos.DrawCube(n.worldPosition, Vector3.one * (nodeDiameter - 0.1f));
            }
        }
    }
    else
    {
        if (grid != null)
        {
            // have the pathfinding detect where the Player is
            // FORTESTING Node playerNode = NodeFromWorldPoint(playerPlaceholder.position);
            

            foreach (Node n in grid)
            {
                // visualize what is walkable 
                Gizmos.color = (n.walkable ? new Color(0, 0, 1, 0.5f) : new Color(1, 0, 0, 0.5f));
                if (path != null)
                {
                    if (path.Contains(n))
                    {
                        Gizmos.color = new Color(0, 1, 0, 0.5f);
                    }
                }

                // FORTESTING
                // make Player node a different color
                // if (playerNode == n)
                // {
                //     Gizmos.color = new Color(0, 1, 1, 0.5f);
                // }




                // so the cube is the size of the node, and leave a little room for the walls
                Gizmos.DrawCube(n.worldPosition, Vector3.one * (nodeDiameter - 0.1f));
            }
        }

    }

}

public Node NodeFromWorldPoint(Vector3 worldPos)
{
    // use a percentage to determine location on the grid
    // 0 = far left, 0.5 = center, 1 = right
    float percentX = (worldPos.x + gridWorldSize.x / 2) / gridWorldSize.x;
    float percentY = 1 -(((worldPos.z + gridWorldSize.y / 2) / gridWorldSize.y));
    // clamp between 0 and 1
    percentX = Mathf.Clamp01(percentX);
    percentY = Mathf.Clamp01(percentY);
    // need x and y indexes of grid array

    int x = Mathf.RoundToInt((gridSizeX - 1) * percentX);
    int y = Mathf.RoundToInt((gridSizeY - 1) * percentY);
    return grid(x, y);
}

private void OnEnable()
{
    CalculateGridSizeForPathfinding();
}

//calculates the grid size to be navigated
public void CalculateGridSizeForPathfinding()
{
    nodeDiameter = nodeRadius * 2;
    gridSizeX = Mathf.RoundToInt(Maze.instance.iSize.x/nodeDiameter);
    gridSizeY = Mathf.RoundToInt(Maze.instance.iSize.z/ nodeDiameter);
    CreateGrid();
}

private void CreateGrid()
{
    grid = new Node(gridSizeX, gridSizeY);

    Vector3 gridTopLeft = transform.position = new Vector3(-Maze.instance.iSize.x/2, 0.4f, Maze.instance.iSize.z / 2 );


    for (int x = 0; x < gridSizeX; x++)
    {
        for (int y = 0; y < gridSizeY; y++)
        {
            Vector3 worldPoint = gridTopLeft - Vector3.left * (x * nodeDiameter + nodeRadius) + -Vector3.forward * (y * nodeDiameter + nodeRadius);
            // make walkable if there are no collisions in the Unwalkable mask
            bool walkable = !(Physics.CheckSphere(worldPoint, nodeRadius, unWalkableMask));
            // pass this information into each individual node
            grid(x, y) = new Node(walkable, worldPoint, x, y);
        }

    }
}

public List<Node> GetNeighbors(Node node)
{
    List<Node> neighbors = new List<Node>();

    // search in a 3x3 block around the node
    // x = 0 && y = 0 means we are in the center of that (current Node position)
    for(int x = -1; x <= 1; x++)
    {
        for (int y = -1; y <= 1; y++)
        {
            if(x == 0 && y == 0)
                continue;
            
            int checkX = node.gridX + x;
            int checkY = node.gridY + y;

            // check if the node is inside of the grid and if so, add to list
            if (checkX >= 0 && checkX < gridSizeX && checkY >= 0 && checkY < gridSizeY)
            {
                neighbors.Add(grid(checkX,checkY));
            }
        }
    }

    return neighbors;

}

public int MaxSize
{
    get
    {
        return gridSizeX * gridSizeY;
    }
}

}

Pathfinding script:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Diagnostics;

public class PathFinding : MonoBehaviour
{
public static PathFinding instance;
public GameObject seeker, target;


private void Awake()
{
    instance = this;
}


private void Update()
{
    if (seeker != null && target != null)
    {
        StartFindPath();
    }
    if (Input.GetKeyDown(KeyCode.G))
    {
        StartFindPath();
    }

}

public void StartFindPath()
{
    FindPath(seeker.transform.position, target.transform.position);
}


private void FindPath(Vector3 startPos, Vector3 goalPos)
{
     Stopwatch stopWatch = new Stopwatch();
     stopWatch.Start();
    
     Node startNode = GridForPathfinding.instance.NodeFromWorldPoint(startPos);
     Node targetNode = GridForPathfinding.instance.NodeFromWorldPoint(goalPos);

     // list of nodes for Open set
     // **I did not implement the Heap because it kept making my editor crash
     List<Node> openSet = new List<Node>();
     HashSet<Node> closedSet = new HashSet<Node>();

    // add the start node to the open set
    openSet.Add(startNode);

    while(openSet.Count > 0)
    {
        // need to find the node with the lowest f value
        // want to optimize from this nested structure later
        Node currentNode = openSet(0);
        for (int i = 1; i < openSet.Count; i++)
        {
            // move to node with lowest f cost
            // if fCosts are equal, move to the node with the lowest hCost
            if (openSet(i).fCost < currentNode.fCost || openSet(i).fCost == currentNode.fCost && openSet(i).hCost < currentNode.hCost)
            {
                currentNode = openSet(i);
            }
        }
        openSet.Remove(currentNode);
        closedSet.Add(currentNode);

        // if we have found the path
        if(currentNode == targetNode)
        {
            stopWatch.Stop();
            print("path found in: " + stopWatch.ElapsedMilliseconds + " ms");
            RetracePath(startNode, targetNode);
            return;
        }

        foreach(Node neighbor in GridForPathfinding.instance.GetNeighbors(currentNode))
        {
            // if neighbor is not traversable or neighbor is in CLOSED list, skip to next neighbor
            if(!neighbor.walkable || closedSet.Contains(neighbor))
            {
                continue;
            }

            int newMovementCostToNeighbor = currentNode.gCost + GetDistance(currentNode, neighbor);
           
            // if the gCost is lower than the current node and is not already in the Neighbor list
            if (newMovementCostToNeighbor < neighbor.gCost || !openSet.Contains(neighbor)) 
            {
                neighbor.gCost = newMovementCostToNeighbor;
                // hCost is the distnace from this node to the Goal or Target Node
                neighbor.hCost = GetDistance(neighbor, targetNode);
                // set parent of neighbor to currentNode so it can point toward it's origin
                neighbor.parent = currentNode;

                // check if the neighbor is not in the open set, then add
                if (!openSet.Contains(neighbor))
                {
                    openSet.Add(neighbor);
                }
            }
           
        }
    }
}

// get path from Start node to Goal/Target node
private void RetracePath(Node startNode, Node endNode)
{
    List<Node> path = new List<Node>();
    Node currentNode = endNode;

    // retrace steps until we reach the start node
    while (currentNode != startNode)
    {
        path.Add(currentNode);
        currentNode = currentNode.parent;
    }

    // ^^ path is currently in reverse, we need to invert that
    path.Reverse();

    GridForPathfinding.instance.path = path;
    
}

public void VisualizePath()
{
    List<Node> _path = GridForPathfinding.instance.path;

    if (_path != null)
    {
        foreach (Node n in _path)
        {
            Instantiate(GameManager.instance.waypointDot, n.worldPosition, Quaternion.identity);
        }
    }
    else
    {
        GameManager.instance.ShowWarning();
    }
}


int GetDistance(Node nodeA, Node nodeB)
{
    int distX = Mathf.Abs(nodeA.gridX - nodeB.gridX);
    int distY = Mathf.Abs(nodeA.gridY - nodeB.gridY);

    if(distX > distY)
    {
        // formula for getting the shortest path between 2 points
        return 14 * distY + 10 * (distX - distY);
    }
    else
    {
        return 14 * distX + 10 * (distY - distX);

    }
}

}

linux – Why did my default crontab editor change?

I have an Amazon Linux instance I have been using for years as a web server. It’s been awhile since I’ve logged in. Today I logged in and noticed the default crontab editor has been changed from nano to vi.

I have looked, and for the life of me I can’t figure out how to change it back to nano, which begs the question – how did it get changed universally in the first place? What might have caused this?

My two questions are:

  • How could this have happened?
  • How can I change it back (permanently)?

I don’t see anything in the logs or command history to help, but I’ll note that I installed the new/latest acme.sh updater for Let’s Encrypt a couple months ago, and it did install a cronjob for the root user (of which I was aware).

I can change the default editor back by either setting the .selected_editor file/value, or by export EDITOR=/bin/nano, but this seems to only address the issue for the current user (so, if I crontab -e -u <otheruse>, it edits as vi again), but I want the DEFAULT editor changed for crontab, so I always get the same editor, regardless of what user I’m working as.