runtime analysis – Calculate the number of iterations in unusual nested loop

I am trying to calculate the number of iterations of a sequence of nested loops of the form:

N = sum_{j=0}^{j_T} sum_{k=0}^{j} sum_{l=0}^{k} sum_{n=n_0}^{n_T} 1

where $j_T$ and $n_T$ are known constants.

For $n_0 = 0$ the case is trivial and can be calculated using the standard procedure (Sum number of times statement is executed in triple nested loop)

The problem is that in my case $n_0$ is given by a more complex expression:

n_0 = minleft(max(0,k-2l),n_Tright) = maxleft(min(k-2l,n_T),0right)

Basically, the initial value of $n$ in the last sum is $k-2l$, except when its value is lower/greater than the lower/greater limits of the sum, in which case it gets replaced by the corresponding extreme value of the interval (either $0$ or $n_T$).

Any ideas?

unity – Instantiated prefabs dont trigger ontriggerEnter while prefabs created not on runtime, do

I am new to unity and trying to make a bouble trouble game. I have enemy prefabs with BoxCollider with is triggered checked. I also have a shooting script. when I am trying to instantiate the enemy prefabs on runtime, they dont seem to trigger the OnTriggerEnter function, but if I am placing an Enemy prefab not ingame, it does trigger the funtion. I have no idea why.

The on run-time instantiate:

public class CreateBalls : MonoBehaviour
    public Rigidbody prefab;
    public Transform position1;

    void Awake()

        for (int i = 0; i < 1; i++)
            float random = Random.Range(-45.08f, 44.41f);
            Vector3 vec = new Vector3(random, position1.position.y, position1.position.z);
            Rigidbody ball= Instantiate(prefab, vec, position1.rotation) as Rigidbody;


The funtion not being called:

public class DestroyBalls : MonoBehaviour
    public Rigidbody potion;
    public Transform posToSpawn;

    private void OnTriggerEnter(Collider other)
        if (this.gameObject.tag == "Enemy"&& other.gameObject.tag=="Bullet")
           //a code not relevent

Any idea of why the funtion isnt being called? the bullets are tagged “Bullet” and the Enemies are tagged “Enemy”

Runtime Error – String e Merge Sort em C

Estou resolvendo um exercício de Merge Sort em C, submeto em plataforma automática (BOCA). Ele roda certinho na máquina, mas na submissão apresenta RUNTIME ERROR (acredito que seja algo relacionado com o String, já que outro exercício usando inteiros deu certo). Já revisei o código muitas vezes, mas não encontro o problema.
inserir a descrição da imagem aqui
inserir a descrição da imagem aqui

//gcc  E3.c -lm -o E3.exe

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

void imprime(char *vetor){

void preenche(char *vetor, int tamanho, int esq, int dir){
    int fim_e = dir-1,i;
    char *aux = NULL;
    aux = malloc(tamanho);

    for(i=0;esq<=fim_e && dir<tamanho;i++){
        if(vetor(esq) <= vetor(dir)){
            aux(i) = vetor(esq);
            aux(i) = vetor(dir);
    //printf("i = %dn",i);

        aux(i) = vetor(esq);
        aux(i) = vetor(dir);
    for(i = 0;i<tamanho;i++){
        vetor(i) = aux(i);


int main(){

    int n,m,t;

    char *string = NULL;

    string = malloc(20000);

    scanf ("%s", string);

    scanf("%d", &n);
    scanf("%d", &m);

    t = n+m;


    return 0;

delphi – Runtime error 217 – como descobrir uma dll com incompatibilidade

Tenho uma aplicação Delphi que roda normalmente na minha máquina com Windows 10.
Copiando esse programa com todos arquivos e dll específicas para outros computadores, de cara já dá “Runtime error 217”.
Em uma das máquinas com Windows 7, mandei o Windows procurar solução de compatibilidade, e isso funcionou.
Mas em outros, mesmo com Windows 10, o problema permanece.

Tudo indica que é carregada alguma dll nos arquivos do Windows com versão diferente e incompatível. Mas são em torno de 120 dll que são carregadas, apenas 10 são as da pasta da minha aplicação.

Existe alguma técnica para identificar qual seria essa dll?

Como na minha máquina isso não ocorre, não adianta fazer debug nela.

RFC: lightweight 2D C ++ array template with runtime allowances. The logic is that the multiplication is faster than the pursuit of the pointer

Any comments, criticisms or questions on this subject? I use this as the basis for some rectangular board toy programs like Conway's Life and the Snake. Usage includes setting the size of the map at runtime, so the type does not contain size information, only instances.


class Array2D {
   int y;
   type *data;
   // We can't do a copy since we don't know
   // what size to allocate the array.
   Array2D(const Array2D&) = delete;
   Array2D& operator=(const Array2D&) = delete;

   Array2D(Array2D&& move) noexcept :
      y(std::exchange(move.y, 0)),
      data(std::exchange(, nullptr)) {}

   Array2D& operator=(Array2D&& move) noexcept {
      std::swap(y, move.y);

   Array2D( int _x, int _y ) : y(_y) {
      data = new type(_x*y);

   type const *operator()(int i) const {
      return data + (i * y);

   type *operator()(int i) {
      return data + (i * y);

   ~Array2D() {
      delete() data;

javascript – Changed CKEditor toolbar at runtime

We need our standard CKEditor toolbar to omit a specific button on only one type of content. It seems silly to create a whole new text format just for this. I can modify the toolbar via a hook, but the modification is saved and applied everywhere. I can't figure out how to programmatically modify the toolbar for that single type of content.

Could someone point me in the right direction?

thank you,


magento2 – Magento 2 CSS files deleted from theme / web directory after runtime configuration: upgrade

I get a strange problem in recent days, the problem is that all files and folders will come from the folder "/ app / design / frontend / Compnay_Name / Theme_Name / web" after running the command "php bin / magento setup: upgrade" upgrade from SSH.

Below are exact steps which I done from SSH.
I first run below commands remove one directory from appcodeRootways for that I first go to this location in SSH then run below commands
 rm -r payment/

then run below commands from the website root directory
 php bin/magento s:up
 php bin/magento c:f
 php bin/magento c:c
 php bin/magento indexer:reindex

Can anyone suggest us how to find this problem?

c ++ – Runtime error: std :: vector larger than max_size ()

A function that returns an integer 1 or 0 depending on the presence or not of an integer B in the 2D integer vector A. If present, return 1 otherwise 0 of the searchMatrix function.

I get a runtime error with the only test case mentioned in the main () function

Here is my code


using namespace std;

int searchMatrix(vector > &A, int B) {
    vector temp;
    for(int i=0;i B) row-=1;
    vectortemp1(A(row).begin(), A(row).end());
    auto col = lower_bound(temp1.begin(), temp1.end(), B);
    if(col != temp1.end())
        return 1;
        return 0;

int main()
    cout << "Let's print something";
    vector< vector > A {
        {3, 3, 11, 12, 14}, {16, 17, 30, 34, 35}, {45, 48, 49, 50, 52}, {56, 59, 63, 63, 65}, {67, 71, 72, 73, 79},
        {80, 84, 85, 85, 88}, {88, 91, 92, 93, 94}
    int B = 94;
    cout << "Let's print something";
    cout << searchMatrix(A,B);

When debugging using gdb, I get the output under

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped) 

Help me where I am wrong?

catalina – Scilab error: Need to install the old Java SE 6 runtime

Scilab v6.0.2 is downloaded from the official website and installed, but it cannot be opened with the error:

To open "this Java application", you need to install the old Java SE 6 runtime.

I follow the instructions in "More info" and on the Internet to download Java from Apple, but Java cannot be installed because "A newer version of this package is already installed", indicated below:

enter description of image here

My MacOS is Catalina v.10.15.3.
How can I escape this loop?

Thanks for the help in advance.

runtime analysis – The iterative substitution method gives a different solution for T (n) = 3T (n / 8) + n than expected using the master theorem

I like to guess the recurrence time $ T (n) = 3T (n / 8) + n $ using the iterative substitution method. Using the master theorem, I can verify that the operating time is $ O (n). $ However, using the method of subtitution, I arrive at a different response from that expected.

$ T (n) = 3T (n / 8) + n \
= 3T (3T (n / 8 ^ 2) + n) + n = 3 ^ 2T (n / 8 ^ 2) + 3n + n \
= 3 ^ 2 (3T (n / 8 ^ 3) + n) + 3n + n = 3 ^ 3T (n / 8 ^ 3) + 3 ^ 2n + 3n + n $

We can see the pattern: $ 3 ^ iT (n / 8 ^ i) + n * frac {3 ^ i -1} {2} $

Recursion ends when $ i = log_8 n $.

Substitution of i in the discovered pattern,
$ 3 ^ {log_8 n} T (1) + n * frac {3 ^ {log_8 n} -1} {2} = \ n ^ {log_8 3} * c + 0.5n * n ^ {log_8 3 } – 0.5n = n ^ {log_8 3} * c + 0.5n ^ {log_8 3 + 1} -0.5n in O (n ^ {1.52}) $.

What am i doing wrong? why is not my answer $ O (n) $ ?