This file contains hidden or 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 be.tjoener.test; | |
| @SuppressWarnings("PointlessArithmeticExpression") | |
| public final class Feistel { | |
| /** | |
| * Sets the number of rounds, security/speed trade-off | |
| */ | |
| private static final int ROUNDS = 16; |
This file contains hidden or 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.example.demo; | |
| import com.fasterxml.jackson.databind.ObjectMapper; | |
| import lombok.Data; | |
| import lombok.Getter; | |
| import lombok.NoArgsConstructor; | |
| import org.hibernate.annotations.CreationTimestamp; | |
| import org.springframework.boot.CommandLineRunner; | |
| import org.springframework.boot.SpringApplication; | |
| import org.springframework.boot.autoconfigure.SpringBootApplication; |
This file contains hidden or 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
| public final class Person { | |
| private final String firstName; | |
| private final String lastName; | |
| private Person(String firstName, String lastName) { | |
| this.firstName = firstName; | |
| this.lastName = lastName; | |
| } |
This file contains hidden or 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
| @Component | |
| @Order(Ordered.HIGHEST_PRECEDENCE) | |
| @SuppressWarnings({"unchecked", "rawtypes"}) | |
| static final class StringToEnumConverterFactory implements ConverterFactory<String, Enum> { | |
| @Override | |
| public <T extends Enum> Converter<String, T> getConverter(Class<T> targetType) { | |
| return new StringToEnum(getEnumType(targetType)); | |
| } |
This file contains hidden or 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.util.Arrays; | |
| import java.util.stream.Collectors; | |
| import java.util.stream.IntStream; | |
| public class LargestNumber | |
| { | |
| public static void main(String[] args) | |
| { | |
| String number = IntStream.range(1, 31) | |
| .mapToObj(String::valueOf) |
This file contains hidden or 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
| using System.IO; | |
| public static class Misc | |
| { | |
| /// <summary> | |
| /// Calculates the checksum on a v0.90 MD superblock. | |
| /// Don't ask me why I needed it. | |
| /// </summary> | |
| /// <param name="filename"> |
This file contains hidden or 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 | |
| if [ "$#" -lt 1 ] | |
| then | |
| echo "Usage: fix.sh <folder> [folder]...\n" | |
| exit 1 | |
| fi | |
| for d in $@ | |
| do |
This file contains hidden or 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.cmosis.test; | |
| import java.util.Comparator; | |
| public class NaturalOrderComparator implements Comparator<String> | |
| { | |
| static char charAt(String s, int i) | |
| { | |
| if (i >= s.length()) | |
| return 0; |
This file contains hidden or 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.util.Iterator; | |
| import java.util.NoSuchElementException; | |
| public class IteratorWithCurrent<E> implements Iterator<E> | |
| { | |
| private final Iterator<E> it; | |
| private E current; | |
| public IteratorWithCurrent(Iterable<E> iterable) { | |
| it = iterable.iterator(); |
This file contains hidden or 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
| <?php | |
| class EAN13render | |
| { | |
| // These are the different barcode patterns for each digit (7 bit each). | |
| // '1' represents a black line, '0' represents white (no line). | |
| static $Rcodes = array('1110010', '1100110', '1101100', '1000010', '1011100', | |
| '1001110', '1010000', '1000100', '1001000', '1110100'); | |
| // The EAN13 defines three groups of bit patterns. |