Skip to main content

Posts

How can i update my Bot status after a new Channel was Created?

Hello iv made a Ticket Bot and i wanted to make a Counter for the Tickets but when a new ticket gets Created the counter doesn't go up!? and i dont know how to do it so i need you Guys. @bot.event async def on_ready(): print(f'Connected to bot: {bot.user.name}') print(f'Bot ID: {bot.user.id}') category = bot.get_channel(966773969355165746) await bot.change_presence(activity=discord.Activity(type=discord.ActivityType.watching, name=f'Tickets: {len(category.text_channels)}')) source https://stackoverflow.com/questions/71973493/how-can-i-update-my-bot-status-after-a-new-channel-was-created

Adding Spotify Data from zenodo in a DataFrame

I want to add all the data from charts.zip from https://doi.org/10.5281/zenodo.4778562 in a single DataFrame. The data consist of a file per year that contains multiple CSVs. I made the following code: header = 0 dfs = [] for file in glob.glob('Charts/*/201?/*.csv'): region = file.split('/')[1] dates = re.findall('\d{4}-\d{2}-\d{2}', file.split('/')[-1]) weekly_chart = pd.read_csv(file, header=header, sep='\t') weekly_chart['week_start'] = datetime.strptime(dates[0], '%Y-%m-%d') weekly_chart['week_end'] = datetime.strptime(dates[1], '%Y-%m-%d') weekly_chart['region'] = region dfs.append(weekly_chart) all_charts = pd.concat(dfs) But, when I run it, python returns: --------------------------------------------------------------------------- ValueError Traceback (most recent call last) /tmp/ipykernel_12886/3473678833.py in <module> 9

SELF THOUGHT MOBILE DEVS [closed]

SHORT STORY IM 28 Y OLD PERSON LIVING IN MOROCCO 🇲🇦 I WORK A GOUVERNEMENT JOB .. SINCE MY CHILDHOOD I'VE LIKED TO MESS AROUND WITH PC AND TV .. BUT I DID TOOK ANOTHER ROUTE I WANT TO SWITCH CAREER AND LEARN CODING BUT BESIDES MY JOB CAUSE I CAN'T QUITE RIGHT NOW NOT WITH NO RESULTS MY QUESTION IS I WANT TO BE MOBILE DEV SO IS THIS CHOICE HAVE A GOOD FUTURE OR DEMAND ESPECIALLY IN EUROPE OR USA SECOND QUESTION WHERE I SHOULD START JUST LEARNING FROM HOME HOW MUCH TIME DO I NEED WHAT LANGUAGE DO I NEED AND IS IT NECESSARY TO HAVE DEGREES TO WORK WITH A COMPANY IN FUTURE CAN YOU AT LEAST MAKE SOME FREELANCE job just by learning more at home . Thank you 😍😍 source https://stackoverflow.com/questions/71973652/self-thought-mobile-devs

SERVER/CLIENT cannot send and recieve data on the same socket, server close server after first attempt

Hi im trying to create a backup function for my program, the idea is to copy and send all the files from one especific folder from my client to the server, the issue here is everytime i send the file name and size of every file as a list the server close the conecction after its recieve but i need the server to ask the client for the data of the files itself, the main is like follows make a list of all files on folder -------> send the list of Files and size via sockets ------> recieve and ask back the file i want to copy one by one ----->send the data of the actual file -----> repeat until the list is over it supose i handle the data send using the ready read signal but for some reason i cant send the actual data, the conecction is closed, this is a good way on handling the data? or its better to send all data at once? like filename + <SEP> + datafile theres any way to split the data recive without messing the data of the file??? i add my actual code, the client

How do I convert a Geotif into a png?

I have a 32-bit float geotif file as a DEM layer. In ArcGIS I tried to convert the tif file into a 8-bit unsigned but the output was a completely black image. The output options for GIS are 8bit or 16bit. Is it possible to convert a 32-bit float DEM.tif to a png without losing pixel value information? Can this be accomplished in ArcGIS or would it have to run in R or Python? source https://stackoverflow.com/questions/71973083/how-do-i-convert-a-geotif-into-a-png

js reduce method point of array

In the reduce method the following works: let dolphins = [92,108,89] dolphins = dolphins.reduce(function(a,b){ return a + b/dolphins.length},0) note that inside the reduce function we have access to dolphins. From the documentation we have: array.reduce(function(total, currentValue, currentIndex, arr), initialValue) Parameters Parameter Description function() Required. A function to be run for each element in the array. Reducer function parameters: total Required. The initialValue, or the previously returned value of the function. currentValue Required. The value of the current element. currentIndex Optional. The index of the current element. arr Optional. The array the current element belongs to. What's the point of passing the array since the function already has access to it? Via Active questions tagged javascript - Stack Overflow https://ift.tt/qv9MHlC

electron app.getPath errors saying app as undefined

Can someone help explain how to get the method working app.getPath . I created a brand new quasar project and all i simply want to do is call app.getPath("documents") . I've created a new file and exposed it through the context bridge, however it always prints app is undefined . utils.js import { app } from "electron"; export function getDocsFolder() { console.log(app.getPath("documents")) } electron-preload.js import { contextBridge } from "electron"; const utils = require("../src/helpers/utils"); contextBridge.exposeInMainWorld("utils", utils); main.vue <template> <q-btn name="Click Me" @click="showInfo"></q-btn> </template> <script> import { defineComponent, ref } from "vue"; export default defineComponent({ name: "MainLayout", setup() { const showInfo= () => { window.utils.getDocsFolder() }; return {