<script>
$.ajax({
url: 'URL',
type: '',
cache: false,
data: {
//Dữ liệu gửi đi
},
success: function(data){
The purpose of design is to allow you to do design later, and it's primary goal is to reduce the cost of change.
- Single Responsibility Principle: a class should have only a single responsibility
- Open-Closed Principle: Software entities should be open for extension, but closed for modification (inherit instead of modifying existing classes).
- Liskov Substitution: Objects in a program should be replaceable with instances of their subtypes without altering the correctness of that program.
- Interface Segregation: Many client-specific interfaces are better than one general-purpose interface.
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.
###Array ####Definition:
- Stores data elements based on an sequential, most commonly 0 based, index.
- Based on tuples from set theory.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
QUEUE using array | |
0 based indexing | |
Save File as Queue.java | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Linked List | |
dynamic memory allocation | |
Save File as LinkedMain.java | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
LINEAR SEARCH | |
0 based indexing | |
array as iterable | |
iterative method | |
Save File as LinearSearch.java | |
*/ | |
import java.io.BufferedReader; | |
import java.io.IOException; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
MAX MIN in array | |
0 based indexing | |
Save File as Maxmin.java | |
*/ | |
class Maxmin_wrapper{ | |
/* Since java's call by reference needs a reference to a object, this class will be used as a wrapper */ | |
public int maximum; | |
public int minimum; |
NewerOlder