python – “”TypeError: ‘Axes3D’ object is not subscriptable”” for 3d animation from data

I am trying to do a 3D animation using data from two arrays. So I paint 2040 triangles in the 3d plain and I don’t want them to change overtime. Then I paint them different colors that I take from another 100 x 2040 array, one color for each triangle. There are 100 moment in time with different colors. So I want my animation to consist of 100 different shots. Is there a way to achieve this using FuncAnimation?
My triangles array – coords, colors array – colors.

The function make_triangles works well for one moment in time, the problem is in the ._offsets3d part, it gives the error graph(i)._offsets3d = make_triangle(i, coords, colors) TypeError: 'Axes3D' object is not subscriptable

Here is my code:

def make_triangles(time, coords, colors):
    one_moment_colors = colors.iloc(:, time)
    fig = plt.figure(figsize=(10, 10))
    ax = Axes3D(fig)
    ax.set_xlim3d(-1, 1)
    ax.set_ylim3d(-1, 1)
    ax.set_zlim3d(-1, 1)
    ax.view_init(0, 10)
    for i in range(int(triangle_amount)):
       one_triangle = coords(i)(:)(:)
       triangle = Poly3DCollection(one_triangle)
       triangle.set_color(colors.rgb2hex((one_moment_colors.iloc(i).item(), 1 - 
                one_moment_colors.iloc(i).item(), 1 - one_moment_colors.iloc(i).item())))
       triangle.set_edgecolor('k')
       ax.add_collection3d(triangle)
return fig, ax

def animate_data(i, coords, colors, graph):
    for i in range(100):
        graph(i)._offsets3d = make_triangles(i, coords, colors)
    return graph

def main(coords, colors):
    fig, graph = make_asteroid(0, coords, colors)
    iterations = 100
    ani = animation.FuncAnimation(fig, animate_data, iterations, fargs=(coords, colors, graph), interval=50, blit=False, repeat=True)
    plt.show()

main(coords, colors)

I was trying to follow this example: https://medium.com/@pnpsegonne/animating-a-3d-scatterplot-with-matplotlib-ca4b676d4b55

I would be very grateful for any suggstions.

google chart – Uncaught TypeError: Cannot read property ‘results’ of null – when reading SharePoint list with JS

I am using an ajax call to get elements of multiple sharepoint list choice(checkboxes) columns called “Orbit”, “SD”,…. to create google pie charts for each column:

data.d.results.forEach(function(row) {
    // each row
    row.Orbit.results.forEach(function(choiceOrbit) {
        // each choice of Orbit of single row
        if (countOrbit.hasOwnProperty(choiceOrbit)) {
            countOrbit(choiceOrbit) += 1;
        } else {
            countOrbit(choiceOrbit) = 1;
        }
    });

But if one row in the column is empty, I get an error:

Uncaught TypeError: Cannot read property 'results' of null
at Statistics.aspx:658
at Array.forEach (<anonymous>)
at Object.success (Statistics.aspx:632)
at i (jquery.min.js:2)
at Object.fireWith (as resolveWith) (jquery.min.js:2)
at A (jquery.min.js:4)
at XMLHttpRequest.<anonymous> (jquery.min.js:4)

How can i add an if(), so that an empty item will be neglected in the counting? Something like:

if(row.Orbit.results.forEach!=null)

or

 if(data.d.results.length > 0)
  {
    // Add your code

  }

or

if(row!=null)

doesnt work

EDIT: my full code is:

<html>
<head>

<script src="https://www.gstatic.com/charts/loader.js" type="text/javaScript"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.min.js" type="text/javaScript"></script>
<script type="text/javaScript">
    $(document).ready(function () {
    var tempArray = ();
    var chartObj = (('Orbit', 'Number'));

AjaxCall(_spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/GetByTitle('list')/items", function (data) {

    var countOrbit = {};
    var countSD = {}; 
    var countMT = {}; 
    var countIT = {}; 
    var countAI = {}; 


    data.d.results.forEach(function(row) {
        // each row
        row.Orbit.results.forEach(function(choiceOrbit) {
            // each choice of Orbit of single row
            if (countOrbit.hasOwnProperty(choiceOrbit)) {
                countOrbit(choiceOrbit) += 1;
            } else {
                countOrbit(choiceOrbit) = 1;
            }
        });
        row.SD.results.forEach(function(choiceSD) {
            // each choice of Orbit of single row
            if (countSD.hasOwnProperty(choiceSD)) {
                countSD(choiceSD) += 1;
            } else {
                countSD(choiceSD) = 1;
            }
        });
        row.MT.results.forEach(function(choiceMT) {
            // each choice of MT of single row
            if (countMT.hasOwnProperty(choiceMT)) {
                countMT(choiceMT) += 1;
            } else {
                countMT(choiceMT) = 1;
            }
        });
        row.IT.results.forEach(function(choiceIT) {
            // each choice of IT of single row
            if (countIT.hasOwnProperty(choiceIT)) {
                countIT(choiceIT) += 1;
            } else {
                countIT(choiceIT) = 1;
            }
        });
        row.AI.results.forEach(function(choiceAI) {
            // each choice of IT of single row
            if (countAI.hasOwnProperty(choiceAI)) {
                countAI(choiceAI) += 1;
            } else {
                countAI(choiceAI) = 1;
            }
        });
    });

    // Load Charts and the corechart package.
    google.charts.load('current', {packages:('corechart')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countOrbit, 'Orbit')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countSD, 'SD')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countMT, 'MT')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countIT, 'IT')});
    google.charts.setOnLoadCallback(function(){drawAllCharts(countAI, 'AI')});


    // Function for all Charts

    function drawAllCharts(countChoices, name) {
        var rows = ();
        for (var property in countChoices) {
            if (countChoices.hasOwnProperty(property)) {
                rows.push((property, countChoices(property)));
            }
        }


        var datatable = new google.visualization.DataTable();
        datatable.addColumn('string', 'Type');
        datatable.addColumn('number', 'Quantity');
        datatable.addRows(rows);
        var options = {
            title: String(name),
            is3D: 'true'
        };
        var chart = new google.visualization.PieChart(document.getElementById(String(name)));
        chart.draw(datatable, options);
    }
    // End of function to draw charts


});
});
                function AjaxCall(url, success) {
                    $.ajax({
                        url: url,
                        type: "GET",
                        headers: {
                            "accept": "application/json;odata=verbose",
                        },
                        success: success,
                        error: function (error) {
                            console.log(JSON.stringify(error));
                            alert('Something Went Wrong');
                        }
                    });
                }
</script>
</head>
  <body>
    <!--Table and divs that hold the pie charts-->
    <table class="columns">
      <tr>
        <td><div id="Orbit" style="width:700px;height:500px;"></div></td>
        <td><div id="SD" style="width:700px;height:500px;"></div></td>
      </tr>
      <tr>
        <td><div id="MT" style="width:700px;height:500px;"></div></td>
        <td><div id="IT" style="width:700px;height:500px;"></div></td>
        <td><div id="AI" style="width:700px;height:500px;"></div></td>
      </tr>
    </table>
  </body>
</html>

TypeError: ‘<‘ not supported between instances of ‘Timestamp’ and ‘int’

Estou tentando colocar na coluna de datas do Dataframe "df_ibov", que se refere as cotações do índice IBOVESPA do período "cotações de dez 2012 abril 2021^BVSP.csv" a lista "datas". Qual a razão de querer fazer isto? A resposta é a seguinte: No Dataframe "df_ibov" há linhas de datas com valores vazios pois se referem a feriados ou finais de semana, mas quero eliminar os valores vazios para ter mais precisão na análise dos dados e para aumentar a acurácia do modelo. Portanto veja abaixo as figuras para fazer isto:
inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

inserir a descrição da imagem aqui

Não consegui corrigir, podem me ajudar?

javascript – Uncaught TypeError: Cannot set property ‘innerHTML’ of null at XMLHttpRequest

Tengo un código para que desde un input select, al seleccionar una opción traiga desde la BD ciertos datos con XMLHttpRequest, sin embargo me esta arrojando el siguiente error justo cuando selecciono una opción del select:

introducir la descripción de la imagen aquí

El fragmento de código de JS es:

<script type="text/javascript">
    function mostrarDatosPsicologo(str){
        if (str==""){
            document.getElementById("txtHint").innerHTML= "";
            return;
        }
        var xmlhttp = new XMLHttpRequest();
        xmlhttp.onreadystatechange=function(){
            if(this.readyState==4 && this.status==200){
                document.getElementById("txtHint").innerHTML=this.responseText;
            }
        }
        
        xmlhttp.open("GET", "../procesos/sesiones/obtenerDatosPsicologo.php?q="+str,true);
        xmlhttp.send();
    }

    //setInterval(function(){mostrarDatosPsicologo();}, 1000);
</script>

El fragmento de código del elemento HTML es:

<div class="row justfy-content-center">
                                <div class="col-sm-4">

                                </div>
                                <div class="col-sm-4 text-center">
                                    <hr>
                                    <label for="psicologo_asignado">Datos del Psicologo asignado</label>
                                    <br>
                                </div>
                            </div>
                            <div class="row">
                                <div class="txtHint"> </div>
                            </div>
                            <hr>

Esto último dentro de un FORM con method="POST", no se si ese sea el error solo que no puedo sacarlo del FORM.

De igual manera comparto el archivo obtenerDatosPsicologo.php:

<!DOCTYPE html>
<html>
<head>

<link rel="stylesheet" href="http://es.stackoverflow.com/public/datatable/dataTables.bootstrap4.min.css">
<link rel="stylesheet" href="http://es.stackoverflow.com/public/bootstrap/bootstrap.min.css">
<link rel="stylesheet" href="http://es.stackoverflow.com/public/datatable/responsive.bootstrap4.min.css">

</head>
<body>
    <?php
    $q=intval($_GET('q'));
    include "../../clases/Conexion.php";
    $con = new Conexion();
    $conexion = $con->conectar();

    if(!$conexion){
        die('No se pudo conectar al servidor: ' . mysqli_error($conexion));
    }
    $sql1= "SELECT 
                id_usuario,
                primer_nombre,
                segundo_nombre,
                apellido_paterno,
                apellido_materno
            FROM
                usuarios
            WHERE
                id = '".$q"'";
    $respuesta1 = mysqli_query($conexion, $sql1);

        echo "<table>
                <tr>
                    <th>Primer Nombre</th>
                    <th>Segundo Nombre</th>
                    <th>Apellido Paterno</th>
                    <th>Apellido Materno</th>
                </tr>";
        while($row= mysqli_fetch_array($respuesta1)){
        echo "<tr>";
        echo "<td>" . $row('primer_nombre') . "</td>";
        echo "<td>" . $row('segundo_nombre') . "</td>";
        echo "<td>" . $row('apellido_paterno') . "</td>";
        echo "<td>" . $row('apellido_materno') . "</td>";
        echo "</tr>";
        }

echo "</table>";

?>

<script src="https://es.stackoverflow.com/public/bootstrap/bootstrap.min.js"></script>
</body>
</html>

La base de datos si tiene los datos y celdas correctamente ya lo verifiqué, también intente mandar mas echo con algunas validaciones dentro del archivo PHP sin embargo el resultado era el mismo.

El setInterval lo puse para hacer una prueba y el error se actualizaba cada segundo, como especifique en el código, solo que no tengo idea si es un error desde JS o cometí algún error en el PHP y no envía los datos correctamente.
Los códigos de JS y PHP los obtuve de W3Schools, seguí las indicaciones que daban.

javascript – TypeError: Cannot read property ‘style’ of null of ionic app

I make an ionic app where I want to change IonLoading’s background color dynamically. But it shows this error.
enter image description here

Please tell me how to slove this. Here is my code:

import React, { useEffect, useState } from 'react';
import { IonContent, IonLoading } from '@ionic/react';
import './Preloader.css'

const Preloader = (props) => {
const { showLoading, loadingTime } = props;
const (loaderData, setLoderData) = useState(());
useEffect(() => {
fetch('myurl')
  .then(res => res.json())
  .then(data => setLoderData(data.content.preloader))
  .catch(error => console.error(error))
}, ())

const el = document.querySelector('.my-custom-class');
el.style.setProperty('--background', `${loaderData.bg_color}`); 
return (
  <IonContent>
  <IonLoading
    cssClass='my-custom-class'
    isOpen={showLoading}     
    spinner= {null}
    duration={loadingTime}
    showBackdrop={false}
    backdropDismiss={true}
    message={`<img src="https://stackoverflow.com/${loaderData.logo}"/>`}
  />     
       
 </IonContent>
 
);
};

export default Preloader;

9 – Uncaught TypeError: value.autocomplete is not a function

After upgrading to Drupal 9 the console gives this error.

Uncaught TypeError: value.autocomplete is not a function 
attach https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:5229
    each https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:2
    attach https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:5208
    attachBehaviors https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:161
    attachBehaviors https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:158
    <anonymous> https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:387
    listener https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:375

As far as I can see, the search autocomplete doesn’t work anymore. This used to be working fine with module https://www.drupal.org/project/search_autocomplete. While upgrading I installed the latest version that should be compatible with Drupal 9.

There are a lot of hints that I could Google about “Uncaught TypeError: …. is not a function”, but I’m at a loss how to approach and solve this specific error.

I hope someone can give practical advise to solve this? Thanks.

magento2 – Magento TypeError: Cannot read property ‘quoteData’ of undefined

main.js:37 TypeError: Cannot read property 'quoteData' of undefined
at quote.js:33

This error is appearing in the browser console and is happening on several pages. Mainly on the registration page. The error is preventing masks from being applied to fields.

What i tried:

Based on this question, I tried to add “domReady!” in the define section, but it didn’t work.

I also tried to add $(document).ready(function() into the file, although it fixed, several other errors started appearing in Checkout, from other files that depend on quote.js.

Uncaught TypeError: value.autocomplete is not a function after upgrading to Drupal 9

After upgrading to Drupal 9 the console gives the error

Uncaught TypeError: value.autocomplete is not a function 
attach https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:5229
    each https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:2
    attach https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:5208
    attachBehaviors https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:161
    attachBehaviors https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:158
    <anonymous> https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:387
    listener https://www.straatbeeld.nl/sites/default/files/js/js_9b9zZvgEpb2pa2AzHALGWUforv-JTw8H3dsTz68pTPs.js:375

As far as I can see, the search autocomplete doesn’t work anymore. This used to be working fine with module https://www.drupal.org/project/search_autocomplete. While upgrading I installed the latest version that should be compatible with Drupal 9.

There are a lot of hints that I could Google about “Uncaught TypeError: …. is not a function”, but I’m at a loss how to approach and solve this specific error.

I hope someone can give practical advise to solve this? Thanks.

jquery – Como solucionar “Uncaught TypeError: $(…) is not a function”

jquery – Como solucionar “Uncaught TypeError: $(…) is not a function” – Stack Overflow en español

python showing this TypeError: string indices must be integers

I’m running this python Code in Kali Terminal and facing this problem
I find this code in Github Cick here
This script download movies from torrent and it uses WebTorrent API
Once I used this script in windows it was working without any error but when I switch to kali and try to run this script I’m facing this error.

I’m not very much familiar with python

Here is my Code

import requests
import subprocess
import sys

def main():
    movie_name = input("Enter the movie name:n")
    print(f"Searching for {movie_name}")
    base_url = f"https://api.sumanjay.cf/torrent/?query={movie_name}"
    torrent_results = requests.get(url=base_url).json()
    index = 1
    magnet = ()
    for result in torrent_results:
        if 'movie' in result('type').lower():
            print(index, ") ", result('name'), "-->", result('size'))
            index += 1
            magnet.append(result('magnet'))
    if magnet:
        choice = int(
            input("Enter the index of the movie which you want to streamn"))
        try:
            magnet_link = magnet(choice-1)
            download = False  # Default is streaming
            stream_choice = int(
                input("Press 1 to stream or Press 2 to download the movien"))
            if stream_choice == 2:
                download = True

            webtorrent_stream(magnet_link, download)
        except IndexError:
            print("Incorrect Index entered")
    else:
        print(f"No results found for {movie_name}")

# Handle Streaming


def webtorrent_stream(magnet_link: str, download: bool):
    cmd = ()
    cmd.append("webtorrent")
    cmd.append(magnet_link)
    if not download:
        cmd.append('--vlc')

    if sys.platform.startswith('linux'):
        subprocess.call(cmd)
    elif sys.platform.startswith('win32'):
        subprocess.call(cmd, shell=True)


if __name__ == "__main__":
    main()

Error

Enter the movie name:
Baby Boss
Searching for Baby Boss
Traceback (most recent call last):
  File "/home/shiva/Desktop/TorrFlix/play.py", line 61, in <module>
    main()
  File "/home/shiva/Desktop/TorrFlix/play.py", line 23, in main
    if 'movie' in result('type').lower():
TypeError: string indices must be integers

DreamProxies - Cheapest USA Elite Private Proxies 100 Cheapest USA Private Proxies Buy 200 Cheap USA Private Proxies 400 Best Private Proxies Cheap 1000 USA Private Proxies 2000 USA Private Proxies 5000 Cheap USA Private Proxies ExtraProxies.com - Buy Cheap Private Proxies Buy 50 Private Proxies Buy 100 Private Proxies Buy 200 Private Proxies Buy 500 Private Proxies Buy 1000 Private Proxies Buy 2000 Private Proxies Proxies123.com