loops

Discord py more than one tasks.loop at the same time?

房东的猫 提交于 2021-02-11 13:30:39
问题 How can I have more than one loop running ate the same time using the same function but using different parameters like: @tasks.loop(seconds = 10) async def loop(name): Print(name) loop.start("Jon") loop.start("Joseph") Is this how u pass parameters to loops? 回答1: You need to create a new Loop object for each loop. You can do this by using regular function calling repeatedly instead of the decorator: async def loop(name): print(name) names = ["Jon", "Joseph"] loops = {name: tasks.loop(seconds

React - Can't find the leak, infinite state declaration suspected

ε祈祈猫儿з 提交于 2021-02-11 13:27:20
问题 I'm a complete beginner in React and I was pretty happy with my first app since I, maybe, have a memory leak ? My app is very laggy after entering value in the input, after click on the add button, at bottom right, and I suspect that I don't use 'useState' like I should ? I dunno, I've been searching for hours :( ... Here's the app : https://n3g.gitlab.io/react-conso-energie/ Here's the code : In the App.js (parent) : import React, { useState } from 'react' import firebase from './firebase'

React - Can't find the leak, infinite state declaration suspected

我的梦境 提交于 2021-02-11 13:25:46
问题 I'm a complete beginner in React and I was pretty happy with my first app since I, maybe, have a memory leak ? My app is very laggy after entering value in the input, after click on the add button, at bottom right, and I suspect that I don't use 'useState' like I should ? I dunno, I've been searching for hours :( ... Here's the app : https://n3g.gitlab.io/react-conso-energie/ Here's the code : In the App.js (parent) : import React, { useState } from 'react' import firebase from './firebase'

Merge different lists together in Python

安稳与你 提交于 2021-02-11 12:58:56
问题 I am so called newbie in Python. I have difficulties with lists. I have a loop which take some info from textfile and goes through function. If textfiles lenght is 10 rows then output will be 10 separate lists, like that: [0.45] [0.87] ... and so on, for n+1 times(it depends how long textfile is). How can I put them into single list, like [0.45, 0.87, ...]? I experimented with different loops but nothing :( I am previously thankfull :) .. and sry about my bad english Code: from pyfann import

Merge different lists together in Python

自闭症网瘾萝莉.ら 提交于 2021-02-11 12:58:06
问题 I am so called newbie in Python. I have difficulties with lists. I have a loop which take some info from textfile and goes through function. If textfiles lenght is 10 rows then output will be 10 separate lists, like that: [0.45] [0.87] ... and so on, for n+1 times(it depends how long textfile is). How can I put them into single list, like [0.45, 0.87, ...]? I experimented with different loops but nothing :( I am previously thankfull :) .. and sry about my bad english Code: from pyfann import

Iterate each user on instagram with specific conditions

烂漫一生 提交于 2021-02-11 12:42:40
问题 I am using selenium and im trying to filter a specific users on instagram with 2 condition : If the profile doesn't have a profile pic (instagram's default pic contains "YW5vbnl..." string) If i already follow this user enter image description here but he doesn't iterate all user, he just iterate 12 times the result of last user however this user is eligible Simple example: enter image description here enter image description here PS : sorry for mistake i am beginner on python 😁 try: browser

Iterate each user on instagram with specific conditions

旧时模样 提交于 2021-02-11 12:41:56
问题 I am using selenium and im trying to filter a specific users on instagram with 2 condition : If the profile doesn't have a profile pic (instagram's default pic contains "YW5vbnl..." string) If i already follow this user enter image description here but he doesn't iterate all user, he just iterate 12 times the result of last user however this user is eligible Simple example: enter image description here enter image description here PS : sorry for mistake i am beginner on python 😁 try: browser

passing variable through AJAX to PHP function getting undefined vairable but not understanding why the index is missing in the construct

让人想犯罪 __ 提交于 2021-02-11 12:41:06
问题 UPDATE - Wondering if it has to do with this line in the PHP function - $cid[] =''; I am getting the dreaded undefined index but even after reading SO answers about it, I am uncertain why the index isn't existing in my instance. I get that the index is missing which is why I see the error, I am not sure why the index is missing however. Is it the initial construction of the string that is causing the issue? Is it the way I am retrieving the $_POST['Cid'] ? When I var-dump I get the expected

passing variable through AJAX to PHP function getting undefined vairable but not understanding why the index is missing in the construct

只愿长相守 提交于 2021-02-11 12:40:20
问题 UPDATE - Wondering if it has to do with this line in the PHP function - $cid[] =''; I am getting the dreaded undefined index but even after reading SO answers about it, I am uncertain why the index isn't existing in my instance. I get that the index is missing which is why I see the error, I am not sure why the index is missing however. Is it the initial construction of the string that is causing the issue? Is it the way I am retrieving the $_POST['Cid'] ? When I var-dump I get the expected

Loop within STACK question in moodle using jsxgraph

旧巷老猫 提交于 2021-02-11 12:36:28
问题 I am trying to create a moodle-STACK question with an interactive element via jsxgraph . Within the [[jsxgraph]] ... [[/jsxgraph]] tags, I am plotting a curve with two databases, each with 6 elements. Since I would like students to add error bars for both scales, I added a loop within the jsxgraph-element : var plot = function() { var j, xr0, yr0, xr1, yr1, xr2, yr2, err1, err2; board.suspendUpdate(); for (j=0; j<6;j++) { const v1 = Number(input1.Value()); const v2 = Number(input2.Value());