Categories
Mastering Development

how to make a table with unique count and count + percentage information

I am a r beginner. Please pardon me if this question sounds silly. If I have a data set like this: x<-data.frame( “ID”=c(21,17,21,19,22,21,26,22,18, 15), “sick”=c(T,T, F, T,T,F, T,T, T, F), “recover”=c(T,T,T,F,F,T,T,T,F,F)) and I want to make a table out of it, something looks like: Note unique count ID is 7, event count is 10. what […]

Categories
Mastering Development

Minimization problem with linking constraints in R

How should I incorporate the linking constraints into the optimization problem formulation in equations 1 – 4 where Y_i’s are binary variables? minimize 22X11 + 20.5X12 + 21X13 + 19X14 + 21X21 + 21X22 + 18X23 + 17X24 + 22X31 + 24X32 + 22X33 + 23X34 + 22X41 + 16X42 + 17X43 + 17.5X44 + […]

Categories
Ask Chemistry

The virtual-virtual block from CISD calculation in PySCF

I am attempting to calculate the virtual-virtual block from a CISD calculation in pyscf. I am first trying to calculate the one-body density for each occupied orbital, from which I can then compute the virtual-virtual block. I have attempted to use the following method: Set up: import numpy as np from pyscf import gto, scf, […]

Categories
Mastering Development

I don’t know how to use codeblocks win32 gui

I used win32 GUI and managed to make some sort of interface after some googling but i don’t know how to make a button do something or to make an integer get value from a textbox in the GUI. This is the main #include <windows.h> #include <commctrl.h> #include <stdio.h> #include “resource.h” HINSTANCE hInst; BOOL CALLBACK […]

Categories
Mastering Development

3D bar plot with dates, strings and numbers in 3 axes with matplotlib in python

I have three lists as mentioned below. xx = [‘TT’, ‘AN’, ‘AP’, ‘AR’, ‘AS’, ‘BR’, ‘CH’, ‘CT’, ‘DN’, ‘DD’, ‘DL’, ‘GA’, ‘GJ’, ‘HR’, ‘HP’, ‘JK’, ‘JH’, ‘KA’, ‘KL’, ‘LA’, ‘LD’, ‘MP’, ‘MH’, ‘MN’, ‘ML’, ‘MZ’, ‘NL’, ‘OR’, ‘PY’, ‘PB’, ‘RJ’, ‘SK’, ‘TN’, ‘TG’, ‘TR’, ‘UP’, ‘UT’, ‘WB’] yy = [datetime.date(2020, 5, 27), datetime.date(2020, 5, 28), […]

Categories
User Help

How come I can’t print this custom excel slide range?

So, I basically wanted to print a range of slides. I have about 800 slides in one PowerPoint and I wanted to print out every other slide, so I made the following numbers separated by a comma using Microsoft Excel: 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71,73,75,77,79,81,83,85,87,89,91,93,95,97,99,101,103,105,107,109,111,113,115,117,119,121,123,125,127,129,131,133,135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165,167,169,171,173,175,177,179,181,183,185,187,189,191,193,195,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225,227,229,231,233,235,237,239,241,243,245,247,249,251,253,255,257,259,261,263,265,267,269,271,273,275,277,279,281,283,285,287,289,291,293,295,297,299,301,303,305,307,309,311,313,315,317,319,321,323,325,327,329,331,333,335,337,339,341,343,345,347,349,351,353,355,357,359,361,363,365,367,369,371,373,375,377,379,381,383,385,387,389,391,393,395,397,399,401,403,405,407,409,411,413,415,417,419,421,423,425,427,429,431,433,435,437,439,441,443,445,447,449,451,453,455,457,459,461,463,465,467,469,471,473,475,477,479,481,483,485,487,489,491,493,495,497,499,501,503,505,507,509,511,513,515,517,519,521,523,525,527,529,531,533,535,537,539,541,543,545,547,549,551,553,555,557,559,561,563,565,567,569,571,573,575,577,579,581,583,585,587,589,591,593,595,597,599,601,603,605,607,609,611,613,615,617,619,621,623,625,627,629,631,633,635,637,639,641,643,645,647,649,651,653,655,657,659,661,663,665,667,669,671,673,675,677,679,681,683,685,687,689,691,693,695,697,699,701,703,705,707,709,711,713,715,717,719,721,723,725,727,729,731,733,735,737,739,741,743,745,747,749,751,753,755,757,759,761,763,765,767,769,771,773,775,777,779,781 The problem is it will only print out if I used all the numbers […]

Categories
Mastering Development

Taking a certain part of the page with selenium

from selenium import webdriver from selenium.webdriver.support.ui import Select from selenium.webdriver import ActionChains import selenium.webdriver.common.keys from bs4 import BeautifulSoup import requests import time driver = webdriver.Chrome(executable_path=”../drivers/chromedriver.exe”) driver.get(“https://www.Here the address of the relevant website ends with aspx.com.aspx”) element=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_LB_SEKTOR”) drp=Select(element) drp.select_by_index(0) element1=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_Lb_Oran”) drp=Select(element1) drp.select_by_index(41) element2=driver.find_element_by_id(“ctl00_ContentPlaceHolder1_LB_DONEM”) drp=Select(element2) drp.select_by_index(1) driver.find_element_by_id(“ctl00_ContentPlaceHolder1_ImageButton1”).click() time.sleep(1) print(driver.page_source) The last part of these codes, I can […]

Categories
Mastering Development

Splitting std::vector of size m into vector of vectors of size n

Given a vector [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17], what are some possible approaches to construct [[1, 2, 3, 4, 5], [6, 7, 8, 9, 10], [11, 12, 13, 14, 15], [16, 17]], focusing primarily on readability? At the moment, I have correctly defined […]

Categories
Linux Mastering Development

script help to extract value

I have the following text file that I want to manipulate add_journal_volume group=”RPCG_VLS_PSALTUXP201″ copy=”TW_PROD_VLS” uid=”60,06,01,60,01,d0,40,00,37,1e,85,5e,17,9c,ea,11″ uid_hash=”0xfd81565b74f160c3″ -f; add_replication_volume group=”RPCG_VLS_PSALTUXP201″ copy=”VNX057_CRR_PSALTUXP201″ replication_set=”RSet0″ uid=”60,06,01,60,0e,60,3c,00,16,f5,56,7f,02,d8,e8,11″ uid_hash=”0xd7c77496f2520fbc” -f; add_replication_volume group=”RPCG_VLS_PSALTUXP201″ copy=”VNX057_CRR_PSALTUXP201″ replication_set=”RSet1″ uid=”60,06,01,60,0e,60,3c,00,18,f5,56,7f,02,d8,e8,11″ uid_hash=”0x62d865f2be9ff409″ -f; Basically I just want to return as column delimited text using “;” RPCG_VLS_PSALTUXP201;TW_PROD_VLS;;60,06,01,60,01,d0,40,00,37,1e,85,5e,17,9c,ea,11 RPCG_VLS_PSALTUXP201;VNX057_CRR_PSALTUXP201;RSet0;60,06,01,60,0e,60,3c,00,16,f5,56,7f,02,d8,e8,11 RPCG_VLS_PSALTUXP201;VNX057_CRR_PSALTUXP201;RSet1;60,06,01,60,0e,60,3c,00,18,f5,56,7f,02,d8,e8,11 The tricky part is those add_journal_volume line there is […]

Categories
Mastering Development

Distance calculation optimization in R

I would like to know if there is any way to optimize the distance calculation process below. I left a small example below, however I am working with a spreadsheet with more than 6000 rows, and it takes considerable time to calculate the variable d. It would be possible to somehow adjust this to have […]