Java's way of sealing the gods [reprint]

Source: Internet
Author: User
Tags solr sql injection sql injection attack variable scope java web jboss neo4j csrf attack

First, the basic article

1.1 JVM

1.1.1. Java memory model, Java memory Management, Java heap and stack, garbage collection

http://www.jcp.org/en/jsr/detail?id=133

http://ifeve.com/jmm-faq/

1.1.2. Understanding the various parameters and tuning of the JVM

1.1.3. Learning to use Java tools

JPS, Jstack, Jmap, Jconsole, Jinfo, Jhat, JAVAP, ...

Http://kenai.com/projects/btrace

http://www.crashub.org/

Https://github.com/taobao/TProfiler

Https://github.com/CSUG/HouseMD

Http://wiki.cyclopsgroup.org/jmxterm

Https://github.com/jlusdy/TBJMap

1.1.4. Learning Java Diagnostic tools

http://www.eclipse.org/mat/

Http://visualvm.java.net/oqlhelp.html

1.1.5. Write various Outofmemory,stackoverflow programs yourself

Heapoutofmemory

Young OutOfMemory

Methodarea OutOfMemory

Constantpool OutOfMemory

Directmemory OutOfMemory

Stack OutOfMemory

Stack OverFlow

1.1.6. Use the tool to try to resolve the following issues and write down the summary

How to find a problem when a Java program responds very slowly

How to resolve a problem when a Java program frequently FULLGC, how to view the garbage collection log

What to do when a Java application OutOfMemory, the younger generation, the old generation, the permanent generation solution is different, causes the reason is also different

1.1.7. References

http://docs.oracle.com/javase/specs/jvms/se7/html/

http://www.cs.umd.edu/~pugh/java/memoryModel/

Http://gee.cs.oswego.edu/dl/jmm/cookbook.html

1.2. Java Basics

1.2.1. Reading the source code

Java.lang.String

Java.lang.Integer

Java.lang.Long

Java.lang.Enum

Java.math.BigDecimal

Java.lang.ThreadLocal

Java.lang.ClassLoader & Java.net.URLClassLoader

Java.util.ArrayList & Java.util.LinkedList

Java.util.HashMap & Java.util.LinkedHashMap & Java.util.TreeMap

Java.util.HashSet & Java.util.LinkedHashSet & Java.util.TreeSet

1.2.2. Familiar with various variable type 1.2.3 in Java. Familiar with the use of Java string, familiar with the various functions of string 1.2.4. Familiar with various key words in Java 1.2.5. Learn to use List,map,stack,queue,set

The traversal of the above data structure

Usage scenarios for the above data structures

Java implementation of Array/list sorting

Java.uti.Arrays.sort ()

Java.util.Collections.sort ()

Java implementation of the list to go heavy

The Java implementation goes to the list and needs to preserve the order in which the data is originally presented

Java implementations have least recently used the cache, with Linkedhashmap

1.2.6. Java Io&java NIO, and learn to use

Java.io.*

Java.nio.*

NIO and reactor Design patterns

File encoding, Character set

1.2.7. Java Reflection and Javassist

Reflection and Factory mode

java.lang.reflect.*

1.2.8. Java serialization

java.io. Serializable

What is serialization and why serialization

Serialization vs. Singleton mode

Google serialization Protobuf

1.2.9. Virtual reference, weak reference, soft reference

java.lang.ref.*

Experiment with the recycling of these references

1.2.10. Familiarity with Java System Properties

Java.util.Properties

1.2.11. Familiarity with annotation usage

java.lang.annotation.*

1.2.12. JMS

javax.jms.*

1.2.13. JMX

java.lang.management.*

javax.management.*

1.2.14. Generics and inheritance, generics, and erase 1.2.15. Automatic unboxing and byte code 1.2.16. Implement Callback1.2.17. The Java.lang.Void class uses 1.2.18. Java Agent,premain Functions

Java.lang.instrument

1.2.19. Unit Testing

junit,http://junit.org/

jmockit,https://code.google.com/p/jmockit/

djunit,http://works.dgic.co.jp/djunit/

1.2.20. Java implementation extracts an e-mail message from a piece of text with a regular expression and replaces @ with the # output

java.lang.util.regex.*

1.2.21. Learn to use common Java Tools Library

Commons.lang, commons.* ...

Guava-libraries

Netty

1.2.22. What is Api&spi

Http://en.wikipedia.org/wiki/Application_programming_interface

Http://en.wikipedia.org/wiki/Service_provider_interface

1.2.23. References

JDK Src.zip Source Code

http://openjdk.java.net/

http://commons.apache.org/

https://code.google.com/p/guava-libraries/

http://netty.io/

Http://stackoverflow.com/questions/2954372/difference-between-spi-and-api

Http://stackoverflow.com/questions/11404230/how-to-implement-the-api-spi-pattern-in-java

1.3. Java Concurrency Programming

1.3.1. Read the source code and learn to use

Java.lang.Thread

Java.lang.Runnable

Java.util.concurrent.Callable

Java.util.concurrent.locks.ReentrantLock

Java.util.concurrent.locks.ReentrantReadWriteLock

java.util.concurrent.atomic.atomic*

Java.util.concurrent.Semaphore

Java.util.concurrent.CountDownLatch

Java.util.concurrent.CyclicBarrier

Java.util.concurrent.ConcurrentHashMap

Java.util.concurrent.Executors

1.3.2. Learn to use thread pools to design your own threading pool what 1.3.3 you need to pay attention to. Lock

What are locks, what kinds of locks are there, what are the characteristics of each lock, and what are the applicable scenarios?

What is the meaning of locks in concurrent programming

1.3.4. What is the role of synchronized, synchronized and lock1.3.5. Sleep and wait1.3.6. Wait and notify1.3.7. Write a deadlock program 1.3.8. What is the difference between a daemon thread, a daemon thread and a non-daemon thread, and the usage 1.3.9. The understanding of the volatile keyword

C + + volatile keyword and java volatile keyword

Happens-before semantics

Compiler instruction rearrangement and CPU command rearrangement

Http://en.wikipedia.org/wiki/Memory_ordering

Http://en.wikipedia.org/wiki/Volatile_variable

http://preshing.com/20130702/the-happens-before-relation/

1.3.10. Is the following code thread-safe? Why? Is it thread safe to add a volatile modifier to count? What do you think is a thread-safe way to do this?

public class Sample {

private static int count = 0;

public static void increment () {

count++;

}

}

1.3.11. Explain the differences between the following two sections of code

Code 1

public class Sample {

private static int count = 0;

Synchronized public static void increment () {

count++;

}

}

Code 2

public class Sample {

private static Atomicinteger count = new Atomicinteger (0);

public static void increment () {

Count.getandincrement ();

}

}

1.3.12. References

http://book.douban.com/subject/10484692/

Http://www.intel.com/content/www/us/en/processors/architectures-software-developer-manuals.html

Second, advanced article

2.1. Java bottom-level knowledge

2.1.1. Learn about bytecode, class file formats

Http://en.wikipedia.org/wiki/Java_class_file

Http://en.wikipedia.org/wiki/Java_bytecode

Http://en.wikipedia.org/wiki/Java_bytecode_instruction_listings

http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/

http://asm.ow2.org/

2.1.2. Write a program that requires the ability to implement JAVAP (manual completion without the use of tools such as ASM)

such as Java source code:

public static void Main (string[] args) {

int i = 0;

i + = 1;

I *= 1;

System.out.println (i);

}

After compiling, read the class file to output the following code:

public static void Main (java.lang.string[]);

Code:

stack=2, locals=2, args_size=1

0:iconst_0

1:istore_1

2:iinc 1, 1

5:iload_1

6:iconst_1

7:imul

8:istore_1

9:getstatic #2; Field Java/lang/system.out:ljava/io/printstream;

12:iload_1

13:invokevirtual #3; Method java/io/printstream.println: (I) V

16:return

Linenumbertable:

Line 4:0

Line 5:2

Line 6:5

Line 7:9

Line 8:16

2.1.3. CPU cache, L1,L2,L3 and pseudo share

http://duartes.org/gustavo/blog/post/intel-cpu-caches/

Http://mechanical-sympathy.blogspot.com/2011/07/false-sharing.html

2.1.4. What is tail recursion 2.1.5. Familiarity with bit operations

Add, subtract, multiply, divide and withdraw with bit operation

2.1.6. References

http://book.douban.com/subject/1138768/

http://book.douban.com/subject/6522893/

Http://en.wikipedia.org/wiki/Java_class_file

Http://en.wikipedia.org/wiki/Java_bytecode

Http://en.wikipedia.org/wiki/Java_bytecode_instruction_listings

2.2. Design mode

2.2.1. Implementing AOP

The difference between Cglib and Invocationhandler

http://cglib.sourceforge.net/

Dynamic Proxy mode

Javassist Implementing AOP

http://www.csg.ci.i.u-tokyo.ac.jp/~chiba/javassist/

ASM Implements AOP

http://asm.ow2.org/

2.2.2. Use template method Design patterns and policy design patterns to implement IOC2.2.3. Single-instance mode 2.2.4 for thread safety without synchronized and lock. NIO and reactor design patterns 2.2.5. References

http://asm.ow2.org/

http://cglib.sourceforge.net/

http://www.javassist.org/

2.3. Network programming Knowledge 2.3.1. Java rmi,socket,httpclient2.3.2. An HTTP server that writes a simple static file in Java

Implements client-side caching, supports return 304

Implementation can download a file concurrently

Using the thread pool to process client requests

Processing client requests using NIO

Support for simple rewrite rules

The above functions need to meet the "open and close principle" when implementing

2.3.3. Understand the features of Nginx and Apache servers and build a corresponding server

http://nginx.org/

http://httpd.apache.org/

2.3.4. Implement FTP, SMTP protocol 2.3.5 with Java. What is a CDN? If implemented? What role does DNS play?

Build a DNS server

Build a Squid or Apache traffic server server

http://www.squid-cache.org/

http://trafficserver.apache.org/

Http://en.wikipedia.org/wiki/Domain_Name_System

2.3.6. References

Http://www.ietf.org/rfc/rfc2616.txt

Http://tools.ietf.org/rfc/rfc5321.txt

Http://en.wikipedia.org/wiki/Open/closed_principle

2.4. Framework Knowledge

spring,spring MVC, read the main source code

Ibatis, read the main source code

Build Java server with spring and Ibatis

2.5. Application Server Knowledge

Familiarity with the use of jboss,https://www.jboss.org/overview/

Familiarity with the use of tomcat,http://tomcat.apache.org/

Familiarity with the use of jetty,http://www.eclipse.org/jetty/

Third, advanced article

3.1. Compiling principle knowledge

3.1.1. Using Java to implement the following expression parsing and returning results (syntax and select sysdate-1 from dual in Oracle)

Sysdate

Sysdate-1

Sysdate-1/24

SYSDATE-1/(12*2)

3.1.2. Implementing a filter on a list through a DSL

qlist<map<string, object>> maplist = new qlist<map<string, object>>;

Maplist.add ({"Name": "Hatter Test"});

Maplist.add ({"id":-1, "name": "Hatter Test"});

Maplist.add ({"id": 0, "name": "Hatter Test"});

Maplist.add ({"id": 1, "name": "Test Test"});

Maplist.add ({"id": 2, "name": "Hatter Test"});

Maplist.add ({"id": 3, "name": "Test Hatter"});

Maplist.query ("ID is not null and ID > 0 and name like '%hatter% '");

Requires the return of the matching object in the list, which is the last two objects;

3.1.3. Use Java to implement the following programs (syntax and variable scope processing are similar to JavaScript):

Code:

var a = 1;

var B = 2;

var c = function () {

var a = 3;

println (a);

println (b);

};

C ();

println (a);

println (b);

Output:

3

2

1

2

3.1.4. References

Http://en.wikipedia.org/wiki/Abstract_syntax_tree

https://javacc.java.net/

http://www.antlr.org/

3.2. Operating system knowledge

Ubuntu

Centos

Use Linux to familiarize yourself with shell scripts

3.3. Data storage knowledge

3.3.1. Relational database

Mysql

How to see the execution plan

How to build MySQL master and slave

What is Binlog?

Derby,h2,postgresql

Sqlite

3.3.2. NoSQL

Cache

Redis

Memcached

Leveldb

Bigtable

HBase

Cassandra

Mongodb

Graph database

Neo4j

3.3.3. References

Http://db-engines.com/en/ranking

http://redis.io/

https://code.google.com/p/leveldb/

http://hbase.apache.org/

http://cassandra.apache.org/

http://www.mongodb.org/

http://www.neo4j.org/

3.4. Big Data knowledge

3.4.1. Zookeeper, deploy zk3.4.2 on Linux. Solr,lucene,elasticsearch

Deploy Solr,solrcloud on Linux, add, delete, query index

3.4.3. Storm, Flow-based computing, understanding SPARK,S4

Deploy storm on linux, coordinate with zookeeper, run storm Hello world,local and run debug storm topology in remote mode.

3.4.4. Hadoop, Offline computing

Hdfs: Deploy Namenode,secondarynamenode,datanode, upload files, open files, change files, delete files

MapReduce: Deploy Jobtracker,tasktracker, write Mr Job

Hive: Deploy hive, write hive sql, get results

Presto: Hive, but faster than hive, well worth learning

3.4.5. Distributed Log Collection flume,kafka,logstash3.4.6. Data mining, mahout3.4.7. Resources

http://zookeeper.apache.org/

https://lucene.apache.org/solr/

Https://github.com/nathanmarz/storm/wiki

http://hadoop.apache.org/

http://prestodb.io/

http://flume.apache.org/,http://logstash.net/,http://kafka.apache.org/

http://mahout.apache.org/

3.5. Network Security Knowledge

3.5.1. What is DES, AES3.5.2. What is RSA, DSA3.5.3. What is md5,sha13.5.4. What is SSL, TLS, and why HTTPS is relatively safe 3.5.5. What is a man-in-the-middle attack, if avoid 3.5.6. What is DOS, DDOS, CC attack 3.5.7. What is CSRF attack 3.5.8. What is a CSS attack 3.5.9. What is SQL injection attack 3.5.10. What is a hash collision denial of service attack 3.5.11. Learn and learn the following security-enhancing technologies

http://www.openauthentication.org/

HOTP Http://www.ietf.org/rfc/rfc4226.txt

TOTP Http://tools.ietf.org/rfc/rfc6238.txt

OCRA Http://tools.ietf.org/rfc/rfc6287.txt

Http://en.wikipedia.org/wiki/Salt_ (cryptography)

3.5.12. Sign a certificate with OpenSSL and deploy to Apache or nginx3.5.13. Resources

Http://en.wikipedia.org/wiki/Cryptographic_hash_function

Http://en.wikipedia.org/wiki/Block_cipher

Http://en.wikipedia.org/wiki/Public-key_cryptography

Http://en.wikipedia.org/wiki/Transport_Layer_Security

http://www.openssl.org/

https://code.google.com/p/google-authenticator/

Iv. extension of the article

4.1. Related knowledge

4.1.1. Cloud computing, distributed, highly available, scalable 4.1.2. Virtualization of

https://linuxcontainers.org/

Http://www.linux-kvm.org/page/Main_Page

http://www.xenproject.org/

https://www.docker.io/

4.1.3. Monitoring

http://www.nagios.org/

http://ganglia.info/

4.1.4. Load Balancing

http://www.linuxvirtualserver.org/

4.1.5. Learn to use Git

https://github.com/

https://git.oschina.net/

4.1.6. Learning to use Maven

http://maven.apache.org/

4.1.7. Learning to use Gradle

http://www.gradle.org/

4.1.8. Learn a language in small languages

Groovy

Scala

Lisp, Common Lisp, Schema, Clojure

R

Julia

Lua

Ruby

4.1.9. Trying to understand the nature of coding

Understand the following concepts

ASCII, Iso-8859-1

GB2312, GBK, GB18030

Unicode, UTF-8

Do not use other tool classes/functions such as string.getbytes () to complete the following functions

public static void Main (string[] args) throws IOException {

String str = "Hello, we are Chinese." ";

byte[] utf8bytes = toutf8bytes (str);

FileOutputStream fos = new FileOutputStream ("F.txt");

Fos.write (utf8bytes);

Fos.close ();

}

public static byte[] Toutf8bytes (String str) {

return null; Todo

}

Think of the above program can write a turn GBK?

Write a program to automatically determine what kind of code a file is

4.1.10. Try to understand the nature of time

Time zone & Winter, Daylight Time

Http://en.wikipedia.org/wiki/Time_zone

Ftp://ftp.iana.org/tz/data/asia

Http://zh.wikipedia.org/wiki/%E4%B8%AD%E5%9C%8B%E6%99%82%E5%8D%80

Leap

Http://en.wikipedia.org/wiki/Leap_year

Leap seconds

Ftp://ftp.iana.org/tz/data/leapseconds

System.currenttimemillis () What is the return time?

4.1.11. References

http://git-scm.com/

Http://en.wikipedia.org/wiki/UTF-8

Http://www.iana.org/time-zones

4.2. Extended Learning

4.2.1. JavaScript knowledge 4.2.1.1. What is prototype

Modify the code so that the program outputs "1 3 5":
http://jsfiddle.net/Ts7Fk/

4.2.1.2. What is a closure?

Take a look at this code and explain why you did not alert out "This is Button:1" when pressing Button1, how to modify:

http://jsfiddle.net/FDPj3/1/

4.2.1.3. Learn and learn a JS framework

Jquery

ExtJS

Argularjs

4.2.1.4. Write a Greasemonkey plugin

Http://en.wikipedia.org/wiki/Greasemonkey

4.2.1.5. Learning node. js

http://nodejs.org/

4.2.2. Learning HTML5

Argularjs,https://docs.angularjs.org/api

4.2.3. References

http://www.ecmascript.org/

http://jsfiddle.net/

http://jsbin.com/

http://runjs.cn/

http://userscripts.org/

V. Recommended BOOKS

"Deep Java Virtual machine"

"In-depth understanding of Java virtual machines"

"Effective Java"

"Seven weeks Seven languages"

"Seven weeks Seven data"

The Insider of Hadoop technology

Hbase in Action

"Mahout in Action"

"This is the search engine"

SOLR in Action

In-depth analysis of Java Web Technology Insider

"Large Web site technology architecture"

"High Performance MySQL"

Introduction to the algorithm

The Art of computer programming

"Code Encyclopedia"

The JavaScript authoritative guide

Java's way of sealing the gods [reprint]

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.