博文

HTML 5.2 W3C Recommendation

Key Points: Payment Request API allowpaymentrequest Presentation API allowpresentation iframe Ref: https://www.w3.org/TR/2017/REC-html52-20171214/index.html https://www.infoq.com/news/2017/12/html-5-2-recommendation http://www.infoq.com/cn/news/2018/01/html-5-2-recommendation https://jakearchibald.com/2017/es-modules-in-browsers/

jQuery and Form

inside posting page function postToError ( CBaseError ) { var e = encodeURI ( JSON . stringify ( CBaseError . errors ). replace ( /"/ g , '&quot;' )); //way 1 $('<form action="./ErrorP" method="post"><input name="error" type="hidden" value="'+e+'"></form>').appendTo('body').submit(); //way 2 var newForm = $ ( '<form>' , { 'action' : './ ErrorP ' , 'method' : 'post' }). append ( $ ( '<input>' , { 'name' : 'error' , 'value' : e , 'type' : 'hidden' })); newForm . appendTo ( 'body' ); newForm . submit (); } inside page posted to < script > var Error ={ "errors" :[]}; var e = '@ViewData["Error"]' ; e = e . replace ( /&quot;/ g , '"' ); var a = decodeU...

Java 10

New features and enhancements are tracked through either the Java Enhancement Process as JEPs, or through the Java Community Process for standardization requests (JSRs). Ref: https://www.infoq.com/news/2017/11/Java10JEPs http://openjdk.java.net/jeps/1 https://www.jcp.org/en/home/index

Angular Architecture Summary

图片
summarize this architecture : Anuglar apps contain one or more modules. Every angular application has at least one module which is the root module. Each module contains one or more components and services.A component controls a portion of the view on the browser. Each component contains an HTML template and a class to control the logic for that particular view. The template represents the view in the browser. Module can also have services which contains the business logic of your application. The modules export and import code as when required and finally render the view in the browser. Component Selector : there are three ways to specify the selector. Use it                                   @Component                            HTML as a custom HTML tag      selector: 'app-test',  ...

Metacharacter: Meaning of UNIX

Recognizing metacharacters ~  Home directory `  Command substitution(old style) # Command $ Variable expression & Background job * String wildcard (  Start of subshell )  End of subshell \  Escape next character |  Pipe [  Start of wildcard set ]  End of wildcard set { Start of command block } End of command block ;  Pipeline command separator '  Quote mark (strong) " Quote mark (weak) < Redirect input > Redirect output /  Pathname address separator ?  Single-character wildcard !  Pipeline logical  NOT ---------------------------------------- ps $$ bash --version whoami type clear type exit echo  $SHELL echo $BASH_VERSION pwd ls ------------------- Dealing wildcard Wildcard   Matches ?                Any single character                 ls...

jquery ajax 'Authorization' 'Bearer' 'Basic'

https://stackoverflow.com/questions/5507234/use-basic-authentication-with-jquery-and-ajax Method 1: var uName = "abc" ; var passwrd = "pqr" ; $ . ajax ({ type : '{GET/POST}' , url : '{urlpath}' , headers : { "Authorization" : "Basic " + btoa ( uName + ":" + passwrd ); }, success : function ( data ) { //Success block }, error : function ( xhr , ajaxOptions , throwError ){ //Error block }, }); Method 2: var uName = "abc" ; var passwrd = "pqr" ; $ . ajax ({ type : '{GET/POST}' , url : '{urlpath}' , beforeSend : function ( xhr ){ xhr . setRequestHeader ( 'Authorization' , "Basic " + btoa ( uName + ":" + passwrd )); }, success : function ( data ) { //Success block }, error : function ( xhr , ajaxOptions , throwEr...

SprintBoot start

#The 3 ways to run Spring Boot application 1. In IntelliJ IDEA Ultimate @SpringBootApplication pubic class TestApplication{...} @RestController public class otherController{  @RequestMapping(value="/hello", method=RequestMethod.Get)  public String say(){return "test";} run 'TestApplicaton' 2. mvn spring-boot.run cd projectfolder mvn spring-boot.run 3. java -jar mvn install cd target  > java -jar  projectname-0.0.1-SNAPSHOT.jar #Springboot2.4.4 and Log4j2 --------------------------------------------------------------------------- ##1.1 For console color text, set disableAnsi="false" ; ##1.2  log4j conflict, using <exclusions>; ##1.3 no showing in console,  must be run after SpringApplication.run(MailApplication.class, args); <Console name="Console" target="SYSTEM_OUT">             <PatternLayout disableAnsi="false"          ...