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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>油價計算機</title> | |
<style> | |
table{ | |
border:1px solid black; | |
} |
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.IOException; | |
import java.io.InputStream; | |
import java.time.Duration; | |
import java.time.Instant; | |
import java.util.concurrent.CountDownLatch; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.atomic.AtomicInteger; | |
import reactor.core.publisher.Flux; | |
import reactor.core.publisher.Mono; |
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 org.apache.logging.log4j.Level; | |
import org.apache.logging.log4j.LogManager; | |
import org.apache.logging.log4j.Logger; | |
import org.apache.logging.log4j.core.config.Configurator; | |
import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilder; | |
import org.apache.logging.log4j.core.config.builder.api.ConfigurationBuilderFactory; | |
import org.apache.logging.log4j.core.config.builder.impl.BuiltConfiguration; | |
import org.apache.logging.log4j.core.layout.PatternLayout; | |
/** |
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
public static boolean isValidIDorRCNumber(String ID) { | |
if (ID == null || ID.trim().isEmpty() || !ID.matches("[A-Za-z][A-Da-d1289]\\d{8}")) { | |
return false; | |
} | |
String head = "ABCDEFGHJKLMNPQRSTUVXYWZIO"; | |
char[] id = ID.toUpperCase().toCharArray(); | |
int chksum = (head.indexOf(id[0]) + 10) / 10 | |
+ (head.indexOf(id[0]) + 10) % 10 * 9 % 10; | |
chksum += (id[1] > '@' && id[1] < 'E') ? ((head.indexOf(id[1]) + 10) % 10) * 8 % 10 | |
: (id[1] - 48) * 8 % 10; |
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.awt.image.BufferedImage; | |
import java.awt.Image; | |
import java.io.IOException; | |
import java.io.OutputStream; | |
import javax.imageio.ImageIO; | |
public class ResizeImage { | |
public static void resize(BufferedImage bufferedImage, int maxEdge, OutputStream os) throws IOException { | |
int w = bufferedImage.getWidth(); |
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.util.regex.Pattern; | |
/** | |
* @author Kent Yeh | |
*/ | |
public class ZhBigNum { | |
public static final Pattern ZEROP = Pattern.compile("\\x{96F6}{2,}"); | |
public static void main(String[] args) { |
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.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.InputStream; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.nio.file.Paths; | |
import java.nio.file.StandardOpenOption; | |
import javax.sound.sampled.AudioFormat; |
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 org.osgeo.proj4j.CRSFactory; | |
import org.osgeo.proj4j.CoordinateReferenceSystem; | |
import org.osgeo.proj4j.CoordinateTransform; | |
import org.osgeo.proj4j.CoordinateTransformFactory; | |
import org.osgeo.proj4j.ProjCoordinate; | |
public class Proj4j { | |
/** | |
* https://search.maven.org/search?q=a:proj4j 找出proj4j轉案 | |
* http://www.sunriver.com.tw/taiwanmap/grid_tm2_convert.php#a03 線上轉換(參考範本) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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.math.BigInteger; | |
import java.util.UUID; | |
/** Code from | |
* https://github.com/cchigoriwa/jaxcsd/blob/master/jaxcsd-api/src/main/java/zw/co/hitrac/jaxcsd/api/util/UUIDBasedOID.java | |
*/ | |
public class UUIDBasedOID { | |
protected static final String OID_PREFIX = "2.25"; // {joint-iso-itu-t uuid(25) <uuid-single-integer-value>} | |
NewerOlder