Friday, March 24, 2017

Play with CMD

dir | clip  // copy to clip board
type error.log | clip

echo hello > a.txt     // overrite file

echo hello >> a.txt  // append  file

doskey /HISTORY > history.txt  // copy all commands

MyCommand.exe 1>stdout.txt 2>errors.txt



Copy & Paste a command session as follows:

1.) At the end of your session, click the upper left corner to display the menu.
Then select.. Edit -> Select all

2.) Again, click the upper left corner to display the menu.
Then select.. Edit -> Copy

3.) Open your favorite text editor and use Ctrl+V or your normal

Paste operation to paste in the text.

mod con lines=32766

@echo off

cmd "mode con:cols=140 lines=2500"

@echo off
echo test!
pause

exit


You'll have to kill the program using Ctrl + C where C stands for Cancel.

Friday, March 17, 2017

Spring Rest API Validation

https://jcp.org/en/jsr/detail?id=303

 @NotBlank(message = "username can't empty!")
    String username;


 @NotBlank
    @Size(min = 3, max = 50)
    private String username;

@NotEmpty
    @Length(max = 140)
    private String text;


ConstraintCompositionBoolean operator that is applied to all constraints of a composing constraint annotation.
CreditCardNumberThe annotated element has to represent a valid credit card number.
CreditCardNumber.ListDefines several @CreditCardNumber annotations on the same element.
EmailThe string has to be a well-formed email address.
Email.ListDefines several @Email annotations on the same element.
LengthValidate that the string is between min and max included.
Length.ListDefines several @Length annotations on the same element.
NotBlankValidate that the annotated string is not null or empty.
NotBlank.ListDefines several @NotBlank annotations on the same element.
NotEmptyAsserts that the annotated string, collection, map or array is not null or empty.
NotEmpty.ListDefines several @NotEmpty annotations on the same element.
RangeThe annotated element has to be in the appropriate range.
Range.ListDefines several @Range annotations on the same element.
SafeHtmlValidate a rich text value provided by the user to ensure that it contains no malicious code, such as embedded

Saturday, March 4, 2017

Spring Annotation

Class level annotation
method level  annoation
property level annotation

@Autowired by default use by type

xyz.MyBean
abc.MyBean

resolve that conflict dependency issue using @Qualifier  annotation

@Resource

@Inject

@component scan base package

Spring Annotation









உப்பு மாங்காய்

சுருக்குப்பை கிழவி. சுருக்கங்கள் சூழ் கிழவி. பார்க்கும் போதெல்லாம் கூடையுடனே குடியிருப்பாள். கூடை நிறைய குட்டி குட்டி மாங்காய்கள். வெட்டிக்க...