博文

目前显示的是 2017的博文

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',                <app-test></app-test> as a class name                   selector: '.app-test2',             <div class="app-test2"> </

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  doc.?     ls *.c   ls *.[a-c] *                Any string of character [set]           Any character in set [!set]         Any character not in set -----------------------------------------

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"                            pattern="%style{%d{ISO8601}}{black} %hi

You're Offline

图片
You're Offline July 12, 2017 ⋅ Code From : https://mxb.at/blog/youre-offline/?imm_mid=0f47f9&cmp=em-web-na-na-newsltr_20170719 A truly responsive website should adapt to all kinds of situations. Besides different viewport sizes, there are other factors to consider. A change in connectivity is one of them. Earlier this week, I was sitting in a train on my way to speak at a local meetup. InterCity trains in Austria all have WIFI now, so I was doing some last-minute work on my slides online. Train WIFI being what it is though, the network wasn’t exactly reliable. The connection kept dropping everytime we went through a tunnel or too many passengers were logged on. This is quite a common scenario. People are on the move, network coverage can be poor, internet connections fail. Luckily, we can prepare our websites for this and make them more resilient by building them offline-first . Offline support is awesome, however your users might not be aware of thes

Wijmo FlexGrid / Drag and Drop

Ref: http://wijmo.com/topic/flexgrid-drag-and-drop/ http://wijmo.com/topic/wijgrid-and-draggable-rows/ http://jsfiddle.net/Wijmo5/0z1ou6cn/ http://jsfiddle.net/tzd95q74/ //=================== <div class="container">   <h1>     Dragging Rows from the FlexGrid   </h1>   <p>     You can use the HTML5 drag/drop API to implement row dragging     from, into, or between FlexGrid controls.</p>   <p>     This simple example shows how you can drag rows from the     grid into arbitrary elements. You can easily extend this     to support move operations (by removing the row from the     source grid when the operation is completed) or dropping     into grids (by detecting the drop position and inserting     new rows into the target grid).</p>   <p>     Drag rows from the grid by the row header:</p>   <div id="theGrid"></div>   <p>     And drop them here:</p>   <div id=&quo

142857 (number)

1 × 142,857 = 142,857 2 × 142,857 = 285,714 3 × 142,857 = 428,571 4 × 142,857 = 571,428 5 × 142,857 = 714,285 6 × 142,857 = 857,142 7 × 142,857 = 999,999 (= 142857 + 857142) 9/7      =1.2857142857142857142857142857143 99/7    =14.142857142857142857142857142857 999/7  =142.71428571428571428571428571429 9999/7=1428.4285714285714285714285714286 Ref: https://en.wikipedia.org/wiki/142857_(number) 123456789*9  =1111111101 123456789*18=2222222202 123456789*243=29999999727 123456789*108=13333333212 柯斯特利金的优秀教材《 代数学引论 》 Alexei I Kostrikin (1929~2000). 1929年2月生于大莫雷斯。1952年毕业于莫斯科大学 数学 力学系,1959年获数理科学博士学位。1972年任莫斯科大学高等 代数 《 拓扑与几何 》  是2008年1月1日出版 作者是(美国) Bredon 布里 登    

CSV & javascript

<a href="data:application/csv;charset=utf-8,test,tes,1,encodeURIComponent()" download="test.csv" target="_blank"> CSV</a> Reference: http://wijmo.com/topic/wijgrid-in-csv/ <!DOCTYPE html> < html xmlns =" http://www.w3.org/1999/xhtml "> < head > < title ></ title > <!--jQuery References--> < script src =" http://code.jquery.com/jquery-1.9.1.min.js " type =" text/javascript "></ script > < script src =" http://code.jquery.com/ui/1.10.1/jquery-ui.min.js " type =" text/javascript "></ script > <!--Theme--> < link href =" http://cdn.wijmo.com/themes/aristo/jquery-wijmo.css " rel =" stylesheet " type =" text/css " /> <!--Wijmo Widgets CSS--> < link href =" http://cdn.wijmo.com/jquery.wijmo-pro.all.3.20132.9.min.css " rel =" styles

Request Payload and Anuglar post

Reference:  How to send right format of payload in Angular 2 since the php backend accept only 'x-www-form-urlencoded'? http://stackoverflow.com/questions/38375791/how-to-send-right-format-of-payload-in-angular-2-since-the-php-backend-accept-on import { Http, Response,Headers, RequestOptions} from '@angular/http'; public getUserConfig():Observable<Response>{ let widgetUrl = '/api/getXConfig'; let data =encodeURI('jinData={"USERID":"Jin"}'); let options = new RequestOptions({ withCredentials: true }); var headers = new Headers(); // //headers.append('Content-Type', 'application/json'); //'application/x-www-form-urlencoded') can't send "Request Payload" //headers.append('Content-Type', 'application/x-www-form-urlencoded'); // headers.append('Content-Type', 'text/plain; charset=utf-8'); options.headers=headers; return this._http.

learning angular2

1: Clear Environment   >node –v C:\Users\jchen> del %USERPROFILE%\.npmrc Could Not Find C:\Users\jchen\.npmrc   >rmdir /s/q "c:\Program Files\nodejs" c:\Program Files\nodejs\node_perfctr_provider.man - Access is denied. c:\Program Files\nodejs\npm - Access is denied. c:\Program Files\nodejs\npm.cmd - Access is denied. Access is denied. > rmdir /s/q "%APPDATA%\npm" C:\Users\jchen\AppData\Roaming\npm\NODE_M~1\vs-tac\NODE_M~1\cordova\4300A3~1.0\NODE_M~1\cordova\NODE_M~1\CORDOV~1\NODE_M ~1\CORDOV~1\NODE_M~1\BROWSE~1\NODE_M~1\BROWSE~3\NODE_M~1\COMBIN~1\NODE_M~1\INLINE~1\NODE_M~1 - The directory is not empty. >rmdir /s/q "%APPDATA%\npm-cache" Go Control Panel\All Control Panel Items\Programs and Features uninstall nodejs Manually remove "%APPDATA%\npm" and "%APPDATA%\npm-cache" 2. Install Nodejs Download the file node-v7.7.2-x64.msi from https://nodejs.org/en/dow