- why
- no much traffic
- database/application-server/fron-end all deployed in one box
- low budget
- easy to maintain
- if this is a commercial software system very bad
- single point of failure
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
ARG ARTIFACT_NAME=application.jar | |
ARG BUILD_DIR=/usr/app | |
# Use an appropriate base image | |
FROM azul/zulu-openjdk-alpine:17.0.8.1-17.44.53 AS build | |
ARG ARTIFACT_NAME | |
ARG BUILD_DIR | |
# Set working directory | |
WORKDIR $BUILD_DIR |
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 java.time.*; | |
import java.time.format.*; | |
import java.util.*; | |
public class BookingAlgorithm { | |
public static void main(String[] args) { | |
// Example inputs | |
LocalDateTime startTime = LocalDateTime.of(2023, 3, 22, 9, 0); | |
LocalDateTime endTime = LocalDateTime.of(2023, 3, 22, 17, 0); |
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
server: | |
port: 9000 | |
dgs: | |
graphql: | |
schema-locations: | |
- "file:///D:/IdeaProjects/Temp/schema.graphqls" | |
spring: | |
application: |
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 logging | |
import sys | |
log_format = '%(asctime)s - %(name)s - %(levelname)s - %(message)s' | |
logging.basicConfig(stream=sys.stdout, level=logging.DEBUG, format=log_format) | |
def get_logger(name): | |
return logging.getLogger(name) |
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 java.io.BufferedReader; | |
import java.io.BufferedWriter; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.OutputStreamWriter; | |
public class RocketStages { | |
static final int N = 11000; | |
static final double G = 9.8; | |
static double A[] = new double[N + 100]; |
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
#!/bin/bash | |
usageMessage="Usage: $> docker-container-in.sh {container name}" | |
if [[ -z $1 ]] | |
then | |
echo $usageMessage | |
exit 1 | |
fi | |
#get running container id |
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
#!/bin/bash | |
curl https://[email protected]/Redmart/$REPOSITORY/zip/master --output $REPOSITORY.zip |
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 com.aeon | |
trait Generator[+T] { | |
self => | |
def generate: T | |
def map[S](f: T => S): Generator[S] = new Generator[S] { | |
def generate = f(self.generate) | |
} |
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
object ManagedResource { | |
def withResource[R <: java.io.Closeable, T](resource: R)(consumer: R => T) = { | |
try { | |
consumer(resource) | |
} finally { | |
resource.close | |
} | |
} | |
} |
NewerOlder