google apps script – How to fix jump button issue: cursor moves to cell, but sheet view does not change

I want to create a “jump” button that will take me directly to a dynamic row upon being clicked. My current setup will move my cursor within the correct cell, but for some reason it does not actually move my sheet to the cell – meaning I have to scroll to the row & ultimately defeating the purpose of the button.

I have hidden rows that could be the result of the match function, I thought maybe this was the issue. However, it seems that even for rows that are not hidden, the script does not move the sheet at all.

I’ve paired a match function (in cell AS1) with this script:

function jump() {
      var ss = SpreadsheetApp.getActiveSpreadsheet();
      var s = ss.getSheetByName("Test"); // change to sheet containing dates
      var r = s.getRange("AS1").getValue(); //change A1 to cell containing =match formula
      s.setActiveSelection(s.getRange("C" + r )); 
}

Has anyone seen this issue before? I was looking for a keyboard shortcut online that would take you directly to the cell you are in (as a back-up plan), but I could not find that either.

external sd – Automatically moves files from Android internal storage to the SD card

When I download music to my phone, I can only download the songs to the internal memory using the app. However, I want to save all my music in SD: / Music /. So I just downloaded songs and then regularly go to the file manager and move them to the SD card. Granted, it's not that much of a hassle, but I was wondering if there was a way to automate the process. If this were Windows, I could write a batch script that I would run and move the files because the download location and my desired location are always the same. Or even if there was a possibility that a low-level process would check around every 24 hours to move files.

I don't really want to use a big app or anything like that, because in this case I can continue what I have done so far.

I am currently using LineageOS 16.9.
I'm just wondering if anyone knows how to do it.

Thank you in advance.

flow – Moves files from one SharePoint site to another based on tags

I asked this question yesterday, but with a guest account so I couldn't answer the answers.

I want to be able to upload a batch of documents to a folder, label them with client name and document type, and have each file move to a specific client location that only shows the files associated with it. Is that possible with a flow? It is worth noting that we set up our document library with a folder structure that has multiple levels. Would that make it more difficult?

An example would be that Daniel receives documents for two customers, Chris and Mike. Daniel drags the files into a SharePoint folder that corresponds to the origin of the files. He marks one file as type = "Financial" and client = "Mike" and the other as type = "Personal" client = "Chris" – a flow then moves these files based on the tags … Later in the day Chris reports and sees the uploaded file and the type of file it is. Chris only sees his files, he doesn't see any files that are marked for Mike.

Please let me know if additional details are needed. Our folder structure is sorted by company. We receive the documents from -> type —> year if this makes sense.

Thank you for reading.

Unit – Quaternion.Slerp only moves halfway

I want to either rotate my object 90 degrees on the y-axis when I press right, or -90 degrees on the y-axis when I press left. I want to do this smoothly so I'm using Quaternion.Slerp. But the third spin just turns halfway for some reason.

Here is my code:

public float speed = 5;
bool canTurn = true;

private void Update()
{
    transform.Translate(Vector3.forward * speed * Time.fixedDeltaTime);
}
private void OnTriggerEnter(Collider col)
{
    if (col.gameObject.tag == "Wall")
    {
        //RestartGame
        Destroy(gameObject);
    }
    else if (col.gameObject.tag == "Turn")
    {
        canTurn = true;
    }
}

private void OnTriggerStay(Collider col)
{
    if (col.gameObject.tag == "Turn")
    {
        if (canTurn && Input.GetKeyDown(KeyCode.LeftArrow))
        {
            StartCoroutine(Turn(-90));
            canTurn = false;
        }
        else if (canTurn && Input.GetKeyDown(KeyCode.RightArrow))
        {
            StartCoroutine(Turn(90));
            canTurn = false;
        }
    }
}

IEnumerator Turn(float turnAngle)
{        
    Debug.Log(turnAngle + "turn");
    float angle = transform.rotation.eulerAngles.y + turnAngle;

    Debug.Log(angle);

    Quaternion newRotation = Quaternion.AngleAxis(angle, Vector3.up);

    while (transform.rotation != newRotation)
    {
        transform.rotation = Quaternion.Slerp(transform.rotation, newRotation, .3f);
        yield return new WaitForSeconds(0.0001f);
    }

}

Plotting – combing plots in show[] moves them strangely

I have two diagrams for the same function func1(x_,y_):= Exp(x)-y. One is represented in a "fake" logarithmic linear manner as:

p1 = ContourPlot(func1(10^(x),y) == 0,{x,-3,-1},{y,0.1,10.}) (the x-axis is "log" scale) and the graph is:

pic1

The other is drawn with the built-in one LogLinearPlot() work as:

p2 = LogLinearPlot(Exp(x), {x,10^(-3),10}, PlotRange -> {Automatic,{0.1,10}}, PlotStyle -> Green) and the action is:

pic2

Then I combine them with Show(p1,p2). And since I expect them to collapse, I get the following graphic (blue is instead) p1 and is green p2):

pic3

I do not understand why the two graphics do not coincide …? I checked and the green graph is shifted (and si wrong) while the blue one is correct (at y=10, x=0.35 (correct) for blue curve during x=0.834 for green).

I know that Show() takes the axis scaling of the first diagram into its argument (here) p1). But I thought that instead of matching scales, Show she would draw with that x,y Coordinates of the respective diagrams (I don't really know how Show() combines diagrams with different scales, but same value ranges). Since the x,y Values ​​are the same in both cases (I don't know how Show() would know that though), I expected them to collapse.

Alternatively with Show(p2,p1) I get

pic4

Why do they cross exactly? y=Exp(1)? Why the blue plot in the last picture p1 is not horizontal up x=10^(-3)? How is it decided how the land should be combined? I feel like I'm missing something small but important here. Thanks a lot.

EDIT 1: At the suggestion of @kglr in the comment, I replaced 10^(x) to Exp^(x) in the ContourPlot. The blue curve has changed (the green remains the same) and now the graphics match! But I still don't really understand how Show() decides to combine them and why they didn't initially coincide …? Because now both look exactly like the green curve in Figure 3 above. So now, y=Exp(Exp(x)) and this is true e.g. at the y=10 in pic3. The x=0.834 which does ______________ mean y=Exp(Exp(0.834)) that is the same 10. So that means Show() plans Exp(Exp(x)) to the p2 held in pic3 Exp(10^(x)). I find it strange. How did Show() decide to do that? Thanks a lot.

batch – BatchFile Searches a specific EXTENSION file and moves it to a specific FOLDER

Here is my folder structure, and I want to run a batch file to search all the parent folders and move the existing .dat file to the x subfolder

I need someone to help me with that πŸ™‚ Thank you

– NETWORK FOLDER (WHERE I WANT TO START THE BACTCHFILE)

- PARENT FOLDER 1
     -subfolder 1
     -subfolder 2
     -subfolder 3
     -subfolder x
    files_name.dat

- PARENT FOLDER 2
     -subfolder 1
     -subfolder 2
     -subfolder 3
     -subfolder x
    files_name.dat

- PARENT FOLDER 3
     -subfolder 1
     -subfolder 2
     -subfolder 3
     -subfolder x
    files_name.dat

I am a beginner in coding, at the moment I only have fairly simple code. This code only works if I put the .bat in the PARENT FOLDER. I tried running it in the network folder but it doesn't work.

   @echo off
SetLocal EnableDelayedExpansion
for /F "delims=" %%a in ('dir /b *.dat') do (
  move  /y "%%a" subfolder x
)

Character Improvement – Which terms should be used when moves that refer to game book specific functions are taken from another game book as a move?

You cannot make moves from another game book unless they make sense.

Many movements relate to things specific to their game book – legacy moves talk about members of the legacy, Janus moves talk about their secret identity; Hell, even Outsider moves and talks about their homeworld, although that's a backstory rather than an additional one.

A move from another game book means that you acquire these skills in fiction, not just on your character sheet, and nothing happens unless it makes sense in fiction. For each of these dependent moves, the GM and players must work to make sense in the fiction.

If you already have a protege, legacy, or janus, it's not uncommon for a mentor, legacy, or secret identity to involve another hero. Being secret or unwittingly out of space is not beyond the realm of comic books. But ultimately, if the GM can't find a way to make a move for a character from another playbook, he can't take it.

python – Moves all XLSX files of the past five days (but not today)

If you're using Python 3, you can use it first pathlib to make your path life much easier (especially if you want your scripts to work on both Windows and Linux). If you are not already using Python 3, you should do so.

While your approach works (and could possibly be made a little shorter with a complex regex), you may want to explore different methods of doing this. Instead of manually using the format of your file names, you can use the time the file was last modified (or accessed) and simply filter by:

from datetime import datetime, timedelta
from pathlib import Path
import shutil
from typing import Iterable

def old_files(dir: Path, pattern: str, start: int = -5, end: int = -1) -> Iterable(Path):
    """List all files in `dir` matching `pattern` modified between
    `start` and `end` (both inclusive) days from today.
    """
    today = datetime.today()
    start = (today.replace(hour=0, minute=0, second=0, microsecond=0)
             + timedelta(days=start)).timestamp()
    end = (today.replace(hour=23, minute=59, second=59, microsecond=999999)
           + timedelta(days=end)).timestamp()
    return (file for file in dir.glob(pattern)
            if start <= file.stat().st_mtime <= end)

What you can use:

if __name__ == "__main__":
    dir = Path(r"C:UsersGuilhermeMachadoDocumentsCarteiras")
    new_dir = dir / "Historico"
    for file in old_files(dir, "*.xlsx", start=-5, end=-1)
        shutil.move(file, new_dir)

Note that I used the fact that when dividing a path by a string (`dir /" Historico ") only the path is connected (with the correct path separator depending on your operating system).

I also added one if __name__ == "__main__": Guard, to enable import from this script without running the code, set the number of days to select parameters of a function to which I also added tips and a docstring and followed Python's official style guide, PEP8, by adding spaces around the = for tasks.

Of course, this assumes that you don't have one other Excel spreadsheets that have been changed in this folder in the last five days. In this case, you may be able to customize the pattern to match only the files you want, or you may need to use a different method to filter the files. But that would only mean changing the function, not your entire script. This will localize the changes, making tracking easier.

Unity – After the player collides with the enemy, he moves backwards until he falls off a cliff

My player is basically pushed back forever after hitting an enemy. I tried to change the player's mass to 100, but it still does the same. The force pushing the player is already 1f, so there is something wrong with the code. Code:

(SerializeField) private LayerMask platformsLayerMask;

(SerializeField) private Rigidbody2D rb;

public float MovementSpeed = 100f;

public float JumpingHeight = 100f;

(SerializeField) private BoxCollider2D bc;

public float fallMultiplier = 2.5f;
public float lowJumpMultiplier = 2f;

(SerializeField) private Animator anim;

private enum State {idle, running, jumping, falling, hurt}
private State state = State.idle;

private Collider2D coll;

(SerializeField) private int cherries = 0;
(SerializeField) private Text cherryText;

(SerializeField) private float hurtForce = 10f;

void Awake()
{
    rb = transform.GetComponent();
    bc = transform.GetComponent();
    coll = transform.GetComponent();
    anim = transform.GetComponent();
}

void Update()
{
    if(state != State.hurt)
    {
        Movement();
    }
    VelocityState(); //referencing the void VelocityState
    anim.SetInteger("state", (int)state);
}


void Movement()
{
    float vDirection = Input.GetAxis("Vertical");
    if (coll.IsTouchingLayers(platformsLayerMask) &&  vDirection > 0)//the player is only able to jump if it is on the ground
    {
        rb.velocity = new Vector2(rb.velocity.x, JumpingHeight);
        Debug.Log("Jumping");
        state = State.jumping;
    }

    float hDirection = Input.GetAxis("Horizontal");

    if (hDirection < 0)
    {
        rb.velocity = new Vector2(-MovementSpeed, rb.velocity.y);
        Debug.Log("Going Left");
        transform.localScale = new Vector2(-1, 1); //flips sprite
    }
    else
    {
        if (hDirection > 0)
        {
            rb.velocity = new Vector2(+MovementSpeed, rb.velocity.y);
            Debug.Log("Going Right");
            transform.localScale = new Vector2(1, 1); //flips sprite
        }
        else
        {
            //no keys pressed
            rb.velocity = new Vector2(0, rb.velocity.y);
            Debug.Log("No key pressed");
        }
    }
    if (rb.velocity.y < 0) //reponsive jumping and falling
    {
        rb.velocity += Vector2.up * Physics2D.gravity.y * (fallMultiplier - 1) * Time.deltaTime;
    }
    else if (rb.velocity.y > 0 && vDirection > 0)
    {
        rb.velocity += Vector2.up * Physics2D.gravity.y * (lowJumpMultiplier - 1) * Time.deltaTime;
    }

}




private void VelocityState() //for switching states for animations
{
    if(state == State.jumping) //when jumping, if the player starts falling, switch to falling animation.
    {
        if(rb.velocity.y < 0.1f)
        {
            state = State.falling;
        }
    }
    else if(state == State.falling) //when falling, if the player touches the platform, switch to idle. 
    {
        if (coll.IsTouchingLayers(platformsLayerMask))
        {
            state = State.idle;
        }
    }
    else if (state == State.hurt)
    {
        if (Mathf.Abs(rb.velocity.x) < .1f)
        {
            state = State.idle;
        }
    }
    else if (Mathf.Abs(rb.velocity.x) > Mathf.Epsilon) //if running, switch to running animation. 
    {
        //moving
        state = State.running;
    }
    else //if it is not everything above, idle
    {
        state = State.idle;
    }
}

private void OnTriggerEnter2D(Collider2D collision) //cherries
{
    if (collision.tag == "Collectible") 
    {
        Destroy(collision.gameObject);
        cherries += 1;
        cherryText.text = cherries.ToString();
    }
}

private void OnCollisionEnter2D(Collision2D other) //enemies 
{
    if (other.gameObject.tag == "Enemy")
    {
        if (state == State.falling)
        {
            Destroy(other.gameObject);
        }
        else
        {
            state = State.hurt;
            if(other.gameObject.transform.position.x > transform.position.x)
            {
                //enemy is on my right therefore I should be damaged and moved left
                rb.velocity = new Vector2(-hurtForce, rb.velocity.y);
            }
            else
            {
                //enemy is on my left therefore I should be damaged and moved right
                rb.velocity = new Vector2(+hurtForce, rb.velocity.y);
            }
        }
    }
}