Categories

## Does COVID-19 fit into the Caspar-Klug (Quasi-Equivalence) Theory for virus architecture?

The following is compiled largely from my “Applications of Group Theory to Virology” module I took at The University of York as an undergraduate back in 2012. The icosahedral group $I$ with identity $e$ is given by a two-fold rotation $R_2$ and a three-fold rotation $R_3$ subject to the following presentation: $$I\cong\langle R_2, R_3\mid R_2^2=R_3^3=(R_2R_3)^5=e\rangle.$$ […]

Categories

## How to use ReadFile() in c++ to read bytes of length that are not multiple of 512

I am trying to write raw bytes to a drive. But the function ReadFile() only allowing me to read bytes of length 512 or its multiple. I cannot read bytes of length 10, 180,1000 etc. DWORD NumberOfBytesRead=0; ReadFile(hDevice, nullbuffer, (DWORD)512, &NumberOfBytesRead, (LPOVERLAPPED)NULL); //works ReadFile(hDevice, nullbuffer, (DWORD)1024, &NumberOfBytesRead, (LPOVERLAPPED)NULL); //works ReadFile(hDevice, nullbuffer, (DWORD)1000, &NumberOfBytesRead, (LPOVERLAPPED)NULL); //error […]

Categories

## Cox proportional hazard model

I am trying to run Cox proportional hazard model on a data of 4 groups. Here’s the data: I am using this code: time_Allo_NHL<- c(28,32,49,84,357,933,1078,1183,1560,2114,2144) censor_Allo_NHL<- c(rep(1,5), rep(0,6)) time_Auto_NHL<- c(42,53,57,63,81,140,176,210,252,476,524,1037) censor_Auto_NHL<- c(rep(1,7), rep(0,1), rep(1,1), rep(0,1), rep(1,1), rep(0,1)) time_Allo_HOD<- c(2,4,72,77,79) censor_Allo_HOD<- c(rep(1,5)) time_Auto_HOD<- c(30,36,41,52,62,108,132,180,307,406,446,484,748,1290,1345) censor_Auto_HOD<- c(rep(1,7), rep(0,8)) myData <- data.frame(time=c(time_Allo_NHL, time_Auto_NHL, time_Allo_HOD, time_Auto_HOD), censor=c(censor_Allo_NHL, censor_Auto_NHL, censor_Allo_HOD, […]

Categories

## Production volume forecast in Python with two data frames (available capacity & demand), multiple rows and columns

I have two different downloads with all machines in a production and I want to forecast the production volume based on the available capacity. In case of more demand, the demand should be postponed to the next period and so on. If backlog is processed only demand should be forecasted. E.g. first machine has not […]

Categories

## Find grid cells in 2D grid based on object size and rotation

I am working on a game that uses a grid system that allows the player to place buildings in the world. Each cell in the grid is 64×64. All buildings will be a multiple of 64×64, so everything will evenly fit in the the grid. Below shows an example of a building that is 128×64 […]

Categories

## Encrypt with CryptoJS in JavaScript gives me different results from Java encryption

I am trying to replicate with CryptoJS an encryption done in Java using another library. The encryption’s result in Java is [111,60,-98,107,-60,5,-17,91,-52,60,-105,64,-88,31,97,-102,118,-39,-28,3,70,-12,21,-69,70,-22,-12,-91,102,-21,-88,5,82,-66,-122,34,14,-115,7,82,-55,38,-90,74,-4,62,104,104,61,-78,57,59,-51,31,84,-115,-45,-98,-87,-11,53,98,45,2,-52] and I know that this is the correct payload. So, I am replicating the same encryption with the same values but I don’t get the same array of bytes. The steps are: I […]

Categories

## Find grid cells in 2D grid based on object size and rotation

I am working on a game that uses a grid system that allows the player to place buildings in the world. Each cell in the grid is 64×64. All buildings will be a multiple of 64×64, so everything will evenly fit in the the grid. Below shows an example of a building that is 128×64 […]

Categories

## How to get total tether supply on Ethereum from BigQuery dataset

I’ve noticed that the numbers for Totaly supply of Tethers seem to diverge on the official Tether transparency page and the Etherscan block explorer, and I want to find a way to get the correct number. At the time of writing the difference is: etherscan.io tether token tracker: $3,338,120,254.587539 official tether webpage:$3,278,120,254.58 Obviously just […]

Categories

## Group variable that identifies observations between two values

Probably it’s a simple question and I dunno whats the term I have to search but I haven’t find anything yet. I have a data.table (I’m used to it) or data.frame like this: a = rep(1, 8) b = rep(c(“20″,”30”, “180”, “10”), each = 1) df = data.table(a,b) df a b 1 1 20 2 […]