博文

A framework for building Shopify Apps using Java Spring Boot

  https://www.digitalsanctuary.com/java/a-framework-for-building-shopify-apps-using-java-spring-boot.html https://github.com/devondragon/SpringShopifyAppFramework https://github.com/devondragon/SpringShopifyAppFramework old/deprecated project :https://github.com/natf17/shopify-embedded-app; https://github.com/ChannelApe/shopify-sdk https://www.justblackmagic.com/2021/11/16/can-you-build-a-shopify-app-using-java-spring-boot/ MD5 public String getHash(String str) { //str may be an URL.   try{      MessageDigest mdgt = MessageDigest.getInstance("MD5");      byte[] bs = str.getBytes();      mdgt.update(bs);      return new BigInteger(1, mdgt.digest()).toString(36); //36 hexadecimal string   }catch(Exception e){...} }

BigDecimal in Java

   /**      * //performance tips      *         //1 use BigDecimal.valueOf instead of new BigDecimal      *         //2 use BigDecimal.stripTrailingZeros to avoid unnecessary trailing zeros      *         //3 use BigDecimal.setScale to avoid unnecessary decimal places      *         //4 use BigDecimal.compareTo instead of equals to avoid precision loss      */     public static void main(String[] args) {         //1.1 String VS double as parameter of BigDecimal constructor         BigDecimal num =new BigDecimal(0.1);         //0.1000000000000000055511151231257827021181583404541015625         System.out.println(num);         num =new BigDecimal("0.1");   //0.1    ...

SFTP & CentOS 7.4

 SFTP sftp(Secure File Transfer Protocol)in ssh with ssh start, default port: 22 Envirement:CentOS 7.4 Server IP:192.168.31.55 [root@localhost ~]# groupadd sftp [root@localhost ~]# useradd -g sftp -s /sbin/nologin sftpuser [root@localhost ~]# echo "123456" | passwd --stdin sftpuser [root@localhost ~]# mkdir -p /home/sftp/sftpuser [root@localhost ~]# chown -R sftpuser:sftp /home/sftp/sftpuser [root@localhost ~]# vi /etc/ssh/sshd_config #Subsystem sftp /usr/libexec/openssh/sftp-server Subsystem sftp internal-sftp Match User sftpuser ChrootDirectory /home/sftp AllowTcpForwarding no ForceCommand internal-sftp wq [root@localhost ~]# systemctl restart sshd.service In client side sftp sftpuser@192.168.31.55

module com.A does not "opens com.B" to unnamed module & --add-opens com.A/com.B=ALL-UNNAMED

图片
JDK17:module java.base does not “opens java.lang.reflect“ to unnamed module --add-opens java.base/java.lang.reflect=ALL-UNNAMED Run/Debug Configurations->Configuration-> VM options: --add-opens java.base/java.lang.reflect=ALL-UNNAMED Example 02 Unable to make public java.lang.String com.d.s.f.TestFastJson$Person.getName() accessible: module com.d.s does not "opens com.d.s.f " to unnamed module @6af93788   go to -> Run/Debug Configurations->Configuration-> VM options: --add-opens java.base/java.lang.reflect=ALL-UNNAMED   --add-opens com.d.s / com.d.s.f =ALL-UNNAMED   Reference: h ttps://www.cnblogs.com/stcweb/articles/15114266.html h ttps://www.cnblogs.com/stcweb/articles/15114266.html https://blog.csdn.net/cs779193543/article/details/121502196

Print out a number using the localized number, integer, currency, and percent format for each locale in Java

  private void testloc () { // Print out a number using the localized number, integer, currency, // and percent format for each locale Locale[] locales = NumberFormat. getAvailableLocales () ; double myNumber = - 1234.56 ; NumberFormat[] form = new NumberFormat[ 4 ] ; System. out .println( "FORMAT" ) ; int n = 0 ; for ( int i = 0 ; i < locales. length ; ++i) { if (locales[i].getCountry().length() == 0 ) { continue; // Skip language-only locales } n++ ; form[ 0 ] = NumberFormat. getInstance (locales[i]) ; form[ 1 ] = NumberFormat. getIntegerInstance (locales[i]) ; form[ 2 ] = NumberFormat. getCurrencyInstance (locales[i]) ; form[ 3 ] = NumberFormat. getPercentInstance (locales[i]) ; for ( int j = 0 ; j < 4 ; j++) { System. out .print(n + "." + (j + 1 ) + "." + locales[i].getDisplayName()) ; if (form[j] instanceof DecimalF...