Skip to content

Instantly share code, notes, and snippets.

View Raouf25's full-sized avatar

ABDERRAOUF MAKHLOUF Raouf25

View GitHub Profile
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container-postgresdb
@Raouf25
Raouf25 / StringUtils.java
Last active September 26, 2023 11:41 — forked from rponte/StringUtils.java
Removing accents and special characters in Java: StringUtils.java and StringUtilsTest.java
import java.text.Normalizer;
public class StringUtils {
/**
* Remove toda a acentuação da string substituindo por caracteres simples sem acento.
*/
public static String unaccent(String src) {
return Normalizer
.normalize(src, Normalizer.Form.NFD)
Taxable income fraction Tax rate to be applied to the bracket
Up to €11.294 0%
From €11.295 to €28.797 11%
From €28.798 to €82.341 30%
From €82.342 to €177.106 41%
Over €177.106 45%
public class TaxCalculator {
// Method to calculate the tax based on income
public double calculateTax(double income) {
double tax;
if (income <= 10225) {
tax = 0;
} else if (income <= 26070) {
tax = (income - 10225) * 0.11;
} else if (income <= 74545) {
import java.util.List;
public class TaxCalculator {
// Define a list of tax brackets
private static final List<TaxBracket> taxBrackets = List.of(
new TaxBracket(0, 10225, 0.0),
new TaxBracket(10225, 26070, 0.11),
new TaxBracket(26070, 74545, 0.30),
new TaxBracket(74545, 160336, 0.41),