Categories
Mastering Development

Lightning chart crashes with t.toFixed is not a function

I am using a lightningchart by arction to plot a bar graph and it keeps crashing after adding the rectangle figures with an error message t.toFixed is not a function The series being used is a rectangle series and I’d like to use only one rectangle series because I need them all under one group […]

Categories
Artificial Intelligence (AI) Mastering Development

DQN not learning the game Pong

Hello I’m trying to implement DQN Agent to play Atari-Pong game. But still after 500.000 parameter updates, the model still scores -21. This is my code, do you have any idea what could be wrong? Replaybuffer import random as r from collections import deque import sys class ReplayBuffer(): def __init__(self, buffer_size): self.buffer = deque([], maxlen=buffer_size) […]

Categories
Mastering Development

Python Remove an element from a list of lists if the length is longer than a certain value

This should be an easy and simple problem to solve. I’m trying to iterate through my nested list and remove any lists that are below a certain length. for i in connections: if(len(i) >= 3): continue else: connections.remove(i) This is the nested list: [[55, 35, 19, 1], [2, 78], [3, 78], [6, 78], [], [], […]

Categories
Mastering Development System & Network

Bash completion regularly crashing bash process?

I’ve encountered this on both Debian and Ubuntu. Seemingly randomly, when tab-completing a directory name something will go wrong and the entire bash process exits (code 1). I’ve tried to debug this by running "bash -vvv" but there is no relevant error message. Here is an example of the output of bash -vvv while tab-completing […]

Categories
Mastering Development

TypeError: ‘MovieWriterRegistry’ object is not an iterator

I was trying to create an animation of a sin wave using the FuncAnimation function from matplotlib, but it keeps throwing an error. I am a little new to it, but I read that there is a bug in the latest version? Anyone that can help me is welcome. import numpy as np from matplotlib […]

Categories
Mastering Development

Can I get clarification of what a “data structure that is a list of lists”?

“Build a data structure that will be a list of lists. The lists in the structure will consist of one alphabetic character and then place holders for the number of times that letter is used as the first letter in a word, the number times used as the last letter in word and the sum […]

Categories
Mastering Development

I cannot modify the json I receive from a web request

I am receiving data from a web service that I have done in nodejs. My problem is that I want to add a value to the response so that my server returns it. The result of the request to my database is received by the variable data that has a structure like this: { “nombre”: […]

Categories
Artificial Intelligence (AI) Mastering Development

Crossover method for gene value containing a set of values

I have a chromosome where each gene contain s set of values. Like the following: chromosome = [[A,B,C],[C,B,A],[C,D,],[],[E,F]] The order in each gene values matters. (A,B,C is different to A,C,B) Each value should not appear more than once in a gene. ([A,B,B] is not desirable, B is repeated.) In my current two-point crossover method. The […]

Categories
Mastering Development

how to add multiple files in Linker_Flag variable in scilab?

I am working with Scilab version 6.1.0 and OS is Ubuntu 18.04. I was working to add a toolbox to Scilab for an already existing library. I have interfaced two functions of library in Scilab separately. I am not able to interface them simultaneously. I think the reason is the Linker_Flag variable in file “builder_gateway_cpp.sce” […]

Categories
Mastering Development

Getting specific word from doc file respective of uppercase/lowercase using python?

I am getting following output : [[], [], [‘Audi’], [‘audi’], [‘AuDi’]] But I want [‘Audi’,’audi’,’AuDi’] my code is: from docx import Document document = Document(r’C:\Users\aliassample02.docx’) list1 = [] for para in document.paragraphs: results = re.findall(r’audi’, para.text, re.IGNORECASE) list1.append(results) print(list1)