google sheets – How to select and remove drawing object in macro

I have a Google Sheet template with a button that triggers a macro to make a new copy of itself that can than be edited (code below). I’d like the macro to remove the button on its copy, as there’s no need to make a copy of the copy. However, when I tried to record the steps to delete the button, the code doesn’t appear in the resulting macro.

Is there code that can be added to my CopySheet macro that remove the button object?

Any help would be appreciated.

function CopyDA() {
  var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getRange('A1').activate();
  spreadsheet.copy('Deal Analyser - ');
};

c# – How to make a game object from several game objects in Unity?

Dear Stackoveflow fourm I have programmed a great music game. Unfortunately there is a problem. In my game there are so many objects that my smartphone can’t load the game properly. I have nowhere to find out how to make an object out of many objects.
If someone knows how to do it I would be very happy!

My Script:

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

public class line : MonoBehaviour
{
    
    //Please attach me to the line, then set  dline,tail,mcamera,road,decorates,dieeff.
    //You can add more to make this better!
    public GameObject dline, tail, mcamera, road, decorates, dieeff;

    private GameObject tempgo, tempdia, tempcr;

    public bool direction, alive, start, load, roadmaker;

    public float cameraspeed, temprm;

    public Vector3 offset, tempcrgo;

    private GameObject() dia, cr;

    List<GameObject> go = new List<GameObject>();

    void Start()
    {
        start = false;
        load = true;
        alive = true;
        //find diamonds and crowns
        dia = GameObject.FindGameObjectsWithTag("dia");
        cr = GameObject.FindGameObjectsWithTag("crown");
        //
    }

    void Update()
    {
        if (load == true)
        {
            //save the initial distance between camera and line
            offset = mcamera.transform.position - dline.transform.position;
            cameraspeed = 0.03f;
            load = false;
            //
        }
        //restart
        if (Input.GetKeyDown(KeyCode.R) == true)
        {
            SceneManager.LoadScene("main");
        }
        //
        if (start == false && alive == true)
        {//start game
            if (Input.GetMouseButtonDown(0) == true || Input.GetKeyDown(KeyCode.Space) == true)
            {
                start = true;
                dline.GetComponent<AudioSource>().enabled = true;
            }

        }//

        if (start == true)
        {//turn
            if (Input.GetMouseButtonDown(0) == true || Input.GetKeyDown(KeyCode.Space) == true)
            {
                if (direction == true)
                {
                    direction = false;
                }
                else
                {
                    direction = true;
                }
            }
        }//
         //build road/wall more efficiently
        if (roadmaker)
        {
            temprm += 1;
            //why there is temprm?to reduce the ammount of roads
            //why build one when click?to ensure there is road/wall when line turns(or it will look weird)
            if (temprm % 6 == 1 || Input.GetMouseButtonDown(0) == true || Input.GetKeyDown(KeyCode.Space) == true)
            {
                GameObject.Instantiate(road, dline.transform.position + new Vector3(3, 0, -3), dline.transform.rotation);
                GameObject.Instantiate(road, dline.transform.position + new Vector3(-3, 0, 3), dline.transform.rotation);
            }// // //
        }
        else
        {//when you play ...I dont put the part in Update but if(roadmaker) because these actions will create new gameobject and interfere the copying of road
            GameObject.Instantiate(tail, dline.transform.position, dline.transform.rotation);
            if (Input.GetMouseButtonDown(0) == true || Input.GetKeyDown(KeyCode.Space) == true)
            {
                if (direction == true)
                {
                    go.Add(GameObject.Instantiate(decorates, dline.transform.position + new Vector3(8, -9, -5), dline.transform.rotation));
                }
                else
                {
                    go.Add(GameObject.Instantiate(decorates, dline.transform.position + new Vector3(-5, -9, 8), dline.transform.rotation));
                }
            }
        }//
    }

    void FixedUpdate()
    {//smooth camera
        mcamera.transform.position = Vector3.Lerp(mcamera.transform.position, offset + dline.transform.position, cameraspeed);
        //
        //some 'animations' .I didnt use animation component because I dont know how it works in Unity :(
        foreach (GameObject tempgo in go)
        {
            tempgo.transform.position += new Vector3(0, 0.2f, 0);
        }

        foreach (GameObject tempdia in dia)
        {
            tempdia.transform.localEulerAngles += new Vector3(0, 2, 0);
            if (Mathf.Abs(dline.transform.position.x - tempdia.transform.position.x) < 1 && Mathf.Abs(dline.transform.position.z - tempdia.transform.position.z) < 1 && tempdia.transform.localScale.z > 0)
            {
                tempdia.transform.localScale -= new Vector3(0.3f, 0.3f, 0.3f);
            }
        }
        foreach (GameObject tempcr in cr)
        {
            tempcr.transform.localEulerAngles += new Vector3(0, 2, 0);
            if (Mathf.Abs(dline.transform.position.x - tempcr.transform.position.x) < 2 && Mathf.Abs(dline.transform.position.z - tempcr.transform.position.z) < 2 && tempcr.transform.localScale.z > 0)
            {
                tempcr.transform.localScale -= new Vector3(0.26f, 0.26f, 0.26f);
                tempcrgo = tempcr.transform.position;
            }
            if (tempcr.transform.localScale.z <= 0)
            {
                tempcrgo += new Vector3(Random.Range(-2f, 2f), Random.Range(-1f, 2f), Random.Range(-2f, 2f));
                tempcr.GetComponent<Light>().enabled = true;
                tempcr.transform.position = Vector3.Lerp(tempcr.transform.position, tempcrgo, 0.02f);

            }
        }
        //
        if (start == true && alive == true)
        {//how the line move
            if (direction == true)
            {
                dline.transform.position += new Vector3(0.3f, 0, 0);
            }
            else
            {
                dline.transform.position += new Vector3(0, 0, 0.3f);
            }
        }//
    }

    void OnCollisionEnter(Collision x)
    {//when die...
        if (x.collider.tag == "wall")
        {
            alive = false;
            mcamera.GetComponent<AudioSource>().enabled = true;
            dieeff.SetActive(true);
        }// 
         //when complete the level...
        if (x.collider.tag == "Finish")
        {
            offset = offset + offset + offset + offset;
            cameraspeed = 0.01f;
        }//
    }
}

`

Game Scene

Video Link:

https://drive.google.com/file/d/1dqIqu6tx5thNbCJ1jNndXEJY_a9JJGGe/view?usp=sharing

timeline – Hover and Click action on same object on touch devices

I am building a timeline widget which has 2 interactions on web.

  • Hover to see a particular duration’s details like duration, start time, assigned name.
  • Click to edit details of the timeline

However, the primary use of the timeline widget is on a tablet (touch device). What could be some ways to achieve these interactions on a touch device?

java – How to optimize the check for data types before building an object?

I’m trying to build an object, which uses different methods based on different data types. I.e. it differs from withBooleanValue,withStringValue and withDateValue depending on the data type. What I have is a string, and depending on what that string is (boolean, string or date), I need to build this object. Below is how I went about it.

private List<Answer> getAnswers(Set<Question> questions) {
        List<Answer> answers = new ArrayList<>();
        questions.forEach(question -> {
            Answer.Builder answer = Answer.builder()
                    .withQuestion(question.question());
            if (BooleanUtils.toBooleanObject(question.value()) != null) {
                answer.withValue(AnswerValue.builder()
                        .withBooleanValue(BooleanUtils.toBoolean(question.value()))
                        .build());
            } else {
                try {
                    Date dateValue = DateUtils.parseDate(question.value(), new String(){"dd-MM-YYYY"});
                    answer.withValue(AnswerValue.builder()
                            .withDateValue(dateValue)
                            .build());

                } catch (ParseException e) {
                    answer.withValue(AnswerValue.builder()
                            .withStringValue(question.value())
                            .build());
                }
            }
            answers.add(answer.build());
        });
        return answers;
    }

Is there a better way to do this? Somehow the ifs, and try-catch statements make it look very complicated and I’d like to reduce the lines and complexity with a better way.

python – Why am i getting a ‘float’ object is not subscriptable error

Im expecting to type the number of rows(students) and columns(quizzes) to define how many student take how many quizzes (matrix exactly).
So after i type the quiz marks for each student at each of their quiz, it is expected that i would get a calculation of each student average (exe:student1 avg = quiz1 + quiz2 +quiz3/3 and so on for student 2 and 3) and also get calculation of each quiz average (quiz1 avg = stu1+stu2+stu3/quiz and so on for quiz 2,3,4…)
But for now i didn’t managed to get that as it shows i have a ‘float’ object is not subscriptable error. Why is that?
This is the full code

R = int(input("Enter the number of rows:"))
C = int(input("Enter the number of columns:"))


matrix = ()
print("Enter the entries rowwise:")
for i in range(R):
    a = ()
    for j in range(C):
         a.append(int(input("Student " + str(i+1) + " Quiz " + str(j+1)+":")))
    matrix.append(a)

for i in range(R):
    T1 = 0
    for j in range(C):
        T1 += matrix(i)(j)
    matrix(i) = T1/C
    print()

for i in range(R):
    print("The average mark for student", i+1, "is", matrix(i))



for j in range(C):
    T2 = 0
    for i in range(R):
        T2 += matrix(i)(j)  #This is where i get float object is not subscriptable error
    matrix(j) = T2/R
    print()

for j in range(C):
    print("The average mark for quiz", j+1, "is", int(matrix(j)))


    

timeline – Hover and Click on same object on touch devices

I am building a timeline widget which has 2 interactions on web.

  • Hover to see a particular duration’s details like duration, start time, assigned name.
  • Click to edit details of the timeline

However, the primary use of the timeline widget is on a tablet (touch device). What could be some ways to achieve these interactions on a touch device?

javascript – Apply function on nested object with if statement

let data = {
  "rep": {
    "color": (1,2,3,5)
  },
  "rep.1": {
    "color": (1,3,5),
    "param1": 0.5
  },
  "rep.2": {
    "color": 1,
    "param1": 0.5,
    "param3": 0.1
  },
  "rep.3": {
    "color": 2,
    "param1": 0.5,
    "param4": 0.1
  }
}

//Function
function multiply(el){
  return el.map(x => x * 2)
}

//Desired output
data = {
  "rep": {
    "color": (2,4,6,10)
  },
  "rep.1": {
    "color": (2,6,10),
    "param1": 0.5
  },
  "rep.2": {
    "color": 1,
    "param1": 0.5,
    "param3": 0.1
  },
  "rep.3": {
    "color": 2,
    "param1": 0.5,
    "param4": 0.1
  }
}

audit on object by user in Oracle

Is there some way to audit, for example, a select in a specific table just by one specified user? something like this:

audit select on foo.table by soe;

this command return:

ERROR at line 1:
ORA-01708: ACCESS or SESSION expected

also, it’s not possible using the suggestion:

audit select on foo.table by session by soe;

ERROR at line 1:
ORA-00933: SQL command not properly ended