View black_pixel_ratio.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> image | |
array([[1, 0, 0, 1, 0], | |
[0, 1, 0, 0, 1], | |
[0, 0, 1, 0, 0], | |
[1, 0, 0, 1, 0]]) | |
>>> black_pixel_count = (image == 0).sum() | |
>>> total_pixel_count | |
20 | |
>>> total_pixel_count = image.shape[0] * image.shape[1] | |
>>> total_pixel_count |
View np_argmin_alternative.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import numpy as np | |
>>> x = np.arange(127, 255, 50) | |
>>> x | |
array([127, 177, 227]) | |
>>> x.argmin() | |
0 | |
>>> x = x[::-1] | |
>>> x | |
array([227, 177, 127]) | |
>>> x.argmin() |
View IsClose.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def IsClose(value, target, threshold=0.02): | |
result = (value / target) | |
result = ((1 - threshold) <= result) and (result <= (1 + threshold)) | |
return result |
View pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>edu.gatech</groupId> | |
<artifactId>epidemics-web</artifactId> | |
<version>1.0</version> | |
<name>epidemics</name> |
View docker_cleanup.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# deletes all docker containers | |
docker rm $(docker ps --no-trunc -aq) | |
# deletes dangling docker images (older version of the images) | |
docker images -q -f "dangling=true" | |
# deletes all docker images | |
docker rmi $(docker images -q) | |
# list all docker images |
View pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-configuration-processor</artifactId> | |
<optional>true</optional> | |
</dependency> |
View 3 in one application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> application.properties << | |
spring.profiles.active=container | |
>> application-local.properties << | |
# Local | |
#MySQL configuration |
View pom.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>org.springframework.boot</groupId> | |
<artifactId>spring-boot-starter-data-jpa</artifactId> | |
</dependency> | |
<dependency> | |
<groupId>mysql</groupId> | |
<artifactId>mysql-connector-java</artifactId> | |
<scope>runtime</scope> | |
</dependency> |
View UserRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gatech.epidemics.dao; | |
import edu.gatech.epidemics.model.User; | |
import org.springframework.data.repository.CrudRepository; | |
import org.springframework.stereotype.Repository; | |
/** | |
* @author atalati | |
*/ | |
@Repository |
View AppConfigBean.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package edu.gatech.epidemics; | |
import org.springframework.beans.factory.annotation.Value; | |
import org.springframework.boot.context.properties.ConfigurationProperties; | |
import org.springframework.context.annotation.PropertySource; | |
import org.springframework.stereotype.Component; | |
/** | |
* @author atalati | |
*/ |