Category "loops"

How do I keep grabbing bytes and encrypting them in Python?

cipher = Cipher(algorithms.AES(key), modes.CTR(iv)) decryptor = cipher.decryptor() plaintext = decryptor.update(data[0:4]) paramEntry1 = int.from_bytes(plainte

R : How loop a function creating named dataframes according to dataframes contained in a list passed in argument?

I made a function that takes a dataframe as argument, and creates two dataframes in output according to a threshold value of one of the columns. These 2 output

How to update XML with reading it only once with PowerShell?

Can someone please help me to do the following more efficiently? I am running this code 4 times for updating specific below protocols/file types. I would like t

Loop numbered variables in Excel VBA - [duplicate]

How can I loop through a set of variables which are numbered consecutively (Bay1, Bay2, Bay3, etc.)? I have 10 variables and I need to examine

How do i convert for loop to while loop in c language?

#include<stdio.h> int main(){ int i,j,rows; printf("Input number of rows : "); scanf("%d",&rows); for (i=1;i<=rows;i++) { for (j=1;j<

Js await function inside a map

I have an array of category ids in order, I have to make a map and fetch the items from these categories and in the end keep the original order of the array wha

how can I use if condition inside the loop in r

I defined a function creates 3 random numbers from 1 to 36, and I allowed repetition. I want to test how many times I can get three same numbers in one hand in

Indexing dataframe within a loop

I'ld like to extract specific data from a log-data. In R it looks like that Data Frame I need values from Data$Time of the cases, where Data$Data_Type == "DATA"

iterate over a df and multiply the values by the values of another df

My df1 looks like this:It contains 3 unique project id.The date starts on 01-01-22 and ends on 01-12-28 id date p50 p90 apv1 01-01-22 1000 1000 apv2 01-01-22 1

python 3 how to generate multiple random element in list for loops

I'm doing a coding exercise and it's to build a password generator. I understand I need to utilize the for loop with the list containing the elements but I'm ha

Remove not increasing rows based on other columns values

I have a data frame on R and I want to remove all rows that are not increasing in my column 3. Each row have to be higher or equal than the previous one. But m

What is While Feof alternative for big file downloads?

I use this while loop to fetch the file; <?php while(!feof($fp)){ //get this file with feof but dont tell file location on the server $buffer = fread($fp,

How to stop a while loop after n iterations?

I'm learning python and I am trying to create the guess game with two levels of difficulty: easy (10 tries) and difficult (5 tries). My code works well, but I n

Nested loop not iterating through entire list

I'm having a problem with my nested loop. I have a list of titles and a list of keywords, and I want to create a new list containing all of the titles that cont

How do I tell my program to go back to a certain point after the wrong answer is selected?

In my midterm CYA game, you come across 2 staircases, left and right. You have the option to choose which one you go to, the right advancing you and the left (e

How to iterate over references in a python loop ( for x in range() )

I have a bunch of references for different filenames at the start of my code: _file1_="filename1" _file2_="filename2" _file3_="filename3" _filew1_="anothername

Problems concatenating arrays by session

I apologize in advance for the title, my question is not that easy to explain on it. What I mean by that is the following: Having an array of type, 4x4, it has

Is there a simpler way to hide a message in text?

I'm a newbie in Python. I have a sample.txt with random generated numbers, like: 190372210335873910924370795570288776927025955114012905862203094277820432758989

How to use created functions argument inside the code?

When I create a function and use arguments as variable names in group_by() function there is error: comb <- function(z,x,y) { df <- z %>% group

Looping problem Elden ring runes per level calculation

This code is currently showing the total amount needed to reach the next level, but what I would like it to do is show the complete total amount so for example