Categories
Mastering Development

Fast way to remove array of specific row values from 2D numpy array

I have a 2D array like this: a = np.array([[25, 83, 18, 71], [75, 7, 0, 85], [25, 83, 18, 71], [25, 83, 18, 71], [75, 48, 8, 43], [ 7, 47, 96, 94], [ 7, 47, 96, 94], [56, 75, 50, 0], [19, 49, 92, 57], [52, 93, 58, 9]]) and I want to […]

Categories
Mastering Development

Ordered set of Dataframe values in Pandas

Question: a series named heights_A with values 176.2, 158.4, 167.6, 156.2, and 161.4. These values represent heights of 5 students of class A. Label each student as s1, s2, s3, s4, and s5. another series named weights_A with values 85.1, 90.2, 76.8, 80.4, and 78.9. These values represent weights of 5 students of class A. […]

Categories
Mastering Development

AWS CodeBuild container outputs Access Denied with Terraform apply

Background: I’m working on a data pipeline that uses a collection of AWS resources (e.g. AWS glue, athena, s3, etc.). I’m using Terraform to deploy the AWS resources within AWS CodeBuild. All the Terraform configuration files are stored within a GitHub repo. The CodeBuild project uses the GitHub repo as its source. Problem: When the […]

Categories
Mastering Development

How to use remove a key from HashMap in a loop?

I tried several different things to try to remove a key in my HashMap, but I always get this error: Exception in thread "main" java.util.ConcurrentModificationException I only have this error in the loop, is there really no way to make it work? private void optimizeProfits(HashMap<String, Object> priceList) { int maxSlotsInAnimalPen = 4; int x = […]

Categories
Artificial Intelligence (AI) Mastering Development

When using experience replay in reinforcement learning, which state is used for training?

I’m slightly confused about the experience replay process. I understand why we use batch processing in reinforcement learning, and from my understanding, a batch of states are input into the neural network model. Suppose there are 2 valid moves in the action space (UP or DOWN) Suppose the batch size is 5, and the 5 […]

Categories
Mastering Development

How to limit number of permutations

I have like 20 short strings that I want to permutate, but I just want the permutations that have len=8. I could do something like that, but it calculates aaalll possible permutations and then print. import itertools p = itertools.permutations([s1, s2, s3, s4, s5, s6,…]) for i in p: s = ”.join(j for j in […]

Categories
Linux Mastering Development Ubuntu

How do I get values of certain row by column names?

This is the output for the command aws iam get-credential-report –query ‘Content’ –output text | base64 -d from this output how to grep the values of access_key_1_active and access_key_1_last_rotated of user username mahi-user? user,arn,user_creation_time,password_enabled,password_last_used,password_last_changed,password_next_rotation,mfa_active,access_key_1_active,access_key_1_last_rotated,access_key_1_last_used_date,access_key_1_last_used_region,access_key_1_last_used_service,access_key_2_active,access_key_2_last_rotated,access_key_2_last_used_date,access_key_2_last_used_region,access_key_2_last_used_service,cert_1_active,cert_1_last_rotated,cert_2_active,cert_2_last_rotated <root_account>,arn:aws:iam::929815623526:root,2020-04-13T07:32:24+00:00,not_supported,2020-07-24T04:03:37+00:00,not_supported,not_supported,false,true,2020-07-17T05:20:25+00:00,N/A,N/A,N/A,true,2020-06-26T10:12:43+00:00,2020-07-24T06:20:00+00:00,us-east-1,s3,false,N/A,false,N/A mahi-user,arn:aws:iam::929815623526:user/mahi-user,2020-07-21T06:21:51+00:00,true,no_information,2020-07-21T06:21:53+00:00,N/A,false,true,2020-07-21T06:21:53+00:00,N/A,N/A,N/A,false,N/A,N/A,N/A,N/A,false,N/A,false,N/A

Categories
Linux Mastering Development Ubuntu

How to grep the values of access_key_1_active and access_key_1_last_rotated

This is the output for the command aws iam get-credential-report –query ‘Content’ –output text | base64 -d from this output how to grep the values of access_key_1_active and access_key_1_last_rotated of user username mahi-user? user,arn,user_creation_time,password_enabled,password_last_used,password_last_changed,password_next_rotation,mfa_active,access_key_1_active,access_key_1_last_rotated,access_key_1_last_used_date,access_key_1_last_used_region,access_key_1_last_used_service,access_key_2_active,access_key_2_last_rotated,access_key_2_last_used_date,access_key_2_last_used_region,access_key_2_last_used_service,cert_1_active,cert_1_last_rotated,cert_2_active,cert_2_last_rotated <root_account>,arn:aws:iam::929815623526:root,2020-04-13T07:32:24+00:00,not_supported,2020-07-24T04:03:37+00:00,not_supported,not_supported,false,true,2020-07-17T05:20:25+00:00,N/A,N/A,N/A,true,2020-06-26T10:12:43+00:00,2020-07-24T06:20:00+00:00,us-east-1,s3,false,N/A,false,N/A mahi-user,arn:aws:iam::929815623526:user/mahi-user,2020-07-21T06:21:51+00:00,true,no_information,2020-07-21T06:21:53+00:00,N/A,false,true,2020-07-21T06:21:53+00:00,N/A,N/A,N/A,false,N/A,N/A,N/A,N/A,false,N/A,false,N/A

Categories
Linux Mastering Development Ubuntu

How to grep the values of access_key_1_active and access_key_1_last_rotated

This is the output for the command aws iam get-credential-report –query ‘Content’ –output text | base64 -d from this output how to grep the values of access_key_1_active and access_key_1_last_rotated of a user name mahi-useruser user,arn,user_creation_time,password_enabled,password_last_used,password_last_changed,password_next_rotation,mfa_active,access_key_1_active,access_key_1_last_rotated,access_key_1_last_used_date,access_key_1_last_used_region,access_key_1_last_used_service,access_key_2_active,access_key_2_last_rotated,access_key_2_last_used_date,access_key_2_last_used_region,access_key_2_last_used_service,cert_1_active,cert_1_last_rotated,cert_2_active,cert_2_last_rotated <root_account>,arn:aws:iam::929815623526:root,2020-04-13T07:32:24+00:00,not_supported,2020-07-24T04:03:37+00:00,not_supported,not_supported,false,true,2020-07-17T05:20:25+00:00,N/A,N/A,N/A,true,2020-06-26T10:12:43+00:00,2020-07-24T06:20:00+00:00,us-east-1,s3,false,N/A,false,N/A mahi-user,arn:aws:iam::929815623526:user/mahi-user,2020-07-21T06:21:51+00:00,true,no_information,2020-07-21T06:21:53+00:00,N/A,false,true,2020-07-21T06:21:53+00:00,N/A,N/A,N/A,false,N/A,N/A,N/A,N/A,false,N/A,false,N/A

Categories
CMS Mastering Development Wordpress

I want create a page in my site that will have the following functions:

I want create a page in my site that will have the following functions: I have a admin account and database of images 1.png,2.png,3.png,…,100.png(in google drive say) I will have 50 student accounts s1,s2,s3,…s50 I need to have this automation 1.png will be sent to s1 if Reply is ‘Yes’ within specific time say 10 […]