What should every programmer know about security? Never trust any input! Validate input from all untrusted...

Please Visit: http://ift.tt/1ajReyV

What should every programmer know about security?
Never trust any input!
Validate input from all untrusted sources - use whitelists not blacklists
Plan for security from the start - it's not something you can bolt on at the end
Keep it simple - complexity increases the likelihood of security holes
Keep your attack surface to a minimum
Make sure you fail securely
Use defence in depth
Adhere to the principle of least privilege
Use threat modelling
Compartmentalize - so your system is not all or nothing
Hiding secrets is hard - and secrets hidden in code won't stay secret for long
Don't write your own crypto
Using crypto doesn't mean you're secure (attackers will look for a weaker link)
Be aware of buffer overflows and how to protect against them
http://ift.tt/1jkhQvF
http://ift.tt/1QEAQzr


from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1QEARTR
via LifeLong Community

The Art of Readable Code 1. Code Should Be Easy to Understand I. Surface-Level Improvements 2. Packing...

Please Visit: http://ift.tt/1ajReyV

The Art of Readable Code
1. Code Should Be Easy to Understand
I. Surface-Level Improvements
2. Packing Information into Names
3. Names That Can’t Be Misconstrued
5. Knowing What to Comment
6. Making Comments Precise and Compact

II. Simplifying Loops and Logic
7. Making Control Flow Easy to Read
8. Breaking Down Giant Expressions
9. Variables and Readability
III. Reorganizing Your Code
10. Extracting Unrelated Subproblems
11. One Task at a Time
12. Turning Thoughts into Code
13. Writing Less Code
http://ift.tt/1KyBRr6


from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1MMHxS2
via LifeLong Community

Spring Expression Language the syntax to designate a Spring expression for evaluation at runtime is ...

Please Visit: http://ift.tt/1ajReyV

Spring Expression Language
the syntax to designate a Spring expression for evaluation at runtime is #{ “SpEL expression string”}
#{systemProperties['system.propery.flag'] ?: false }

#{itemBean}
#{itemBean.name} 
@Value("#{itemBean}")
@Value("#{itemBean.name}")

@Value("#{'Thomas Lake Drive'}")
@Value("#{55121}")

@Value("#{systemProperties['os.arch'].equals('x86')? winDataSource : unixDataSource}")

METHOD FACTORY WIRING
@Value("#{fileService.createFile()}")
private File file;

STATIC METHOD WIRING
@Value("#{ T(Math).random()}")
private double powerLevel;

#{otherBean.method().length()}
#{T(java.lang.Integer).MIN_VALUE}
How to avoid exceptions
Instead of a single period (.) you need to precede a period with a question mark (?). 
<property name="prop" value="#{otherBean.method()?.toUpperCase()}"/>
#{otherBean.method() != null ? otherBean.method().length() : -1}

Regular Expressions - tru/false
<property name="onlyDigits" value="#{otherMean.method() matches '\d+'}" />

Collection selection can have another syntax.
<property name="topSubjects" value="#{subjectList.?[id gt 111 and id lt 113]}"/>
<property name="mycity" value="#{cities[2]}"/>

Arithmetic Operations
<property name="mrp"value="#{counter.total+25}"/>

http://ift.tt/1KS4QYr
http://ift.tt/1ixN95p
http://ift.tt/1KS4QYt


from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1ixN95t
via LifeLong Community

Better Java http://ift.tt/1j3lLFj

Please Visit: http://ift.tt/1ajReyV

Better Java
http://ift.tt/1j3lLFj


from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1LLocuB
via LifeLong Community

What Makes a Good Programmer? 1. PROBLEM DECOMPOSITION 2. SCENARIO ANALYSIS The good programmers ask...

Please Visit: http://ift.tt/1ajReyV

What Makes a Good Programmer?
1. PROBLEM DECOMPOSITION
2. SCENARIO ANALYSIS
The good programmers ask themselves: How can this break?
http://ift.tt/1mcD1Po


from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1JmdLMh
via LifeLong Community

How to Clone Collection in Java - Deep copy of ArrayList and HashSet copy constructor of Collection ...

Please Visit: http://ift.tt/1ajReyV

How to Clone Collection in Java - Deep copy of ArrayList and HashSet
copy constructor of Collection in Java only provides shallow copy and not deep copy, which means objects stored in both original List and cloned List will be same and point to same memory location in Java heap.

n order to fix this, we need to deep clone Employee object by iterating over Collection and before that, we need to override clone method for Employee object.

http://ift.tt/1i32MwZ


from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1Fq4BTU
via LifeLong Community