Skip to content

Instantly share code, notes, and snippets.

Andhra Pradesh
Arunachal Pradesh
Assam
Bihar
Chhattisgarh
Goa
Gujarat
Haryana
Himachal Pradesh
Jammu and Kashmir
@anhtuan3996
anhtuan3996 / .zshrc
Created January 16, 2020 02:20 — forked from masnun/.zshrc
Zsh configuration
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="custom"
# Example aliases
@anhtuan3996
anhtuan3996 / import.md
Last active January 16, 2020 03:17 — forked from iamstoick/import.md
How to import database in MySQL in Docker?

This is a simple way of importing MySQL database in Docker.

  1. In you Dockerfile you must have a shared folder. Shared folder is a directory in your host machine that is mounted to Docker instance.

  2. Put the exported sql file in the shared folder.

  3. Login to your Docker instance via docker exec -it DOCKER_CONTAINER_ID bin/bash.

  4. Login to MySQL via mysql -u USERNAME -p.

@anhtuan3996
anhtuan3996 / curl.md
Created December 11, 2019 04:19 — forked from subfuzion/curl.md
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

Now that we have an idea of all the parts of a query, we can now talk about how they all fit together in the context of a complete query. `` Complete SELECT query SELECT DISTINCT column, AGG_FUNC(column_or_expression), … FROM mytable JOIN another_table ON mytable.column = another_table.column WHERE constraint_expression GROUP BY column HAVING constraint_expression

Giới thiệu

Thuộc tính MySQL thường đề cập đến các loại dữ liệu MySQL và các hạn chế đặt trên chúng. Khi bạn khai báo một trường dưới dạng trường số hoặc ký tự dữ liệu, các thuộc tính khác nhau sẽ liên kết với nó. Các thuộc tính này cho phép bạn chỉ định các hạn chế hơn nữa về số lượng hoặc ký tự mà trường có thể lưu trữ.

UNSIGNED Attribute Type:

Bạn có thể chỉ định thuộc tính chưa được ký với các loại dữ liệu MySQL TINYINT, SMALLINT, MEDIUMINT, INT, INTEGER, BIGINT, REAL, DOUBLE, FLOAT, DECIMAL và NUMERIC MySQL. Khi bạn sử dụng thuộc tính UNSIGNED để khai báo trường loại dữ liệu, bạn không thể lưu trữ số âm trong trường đó. Bạn thường sử dụng các thuộc tính UNSIGNED cho các trường để ngăn người dùng cơ sở dữ liệu mắc lỗi nhập. Ví dụ: trường giá trong cơ sở dữ liệu thường UNSIGNED, vì giá thường là một số dương.

ZEROFILL Attribute Type:

Bạn có thể chỉ định thuộc tính ZEROFILL với các loại dữ liệu MySQL TINYINT, SMALLINT, MEDIUMINT, INT, INTEGER, BIGINT, REAL, DOUBLE, FLOAT, DECIMAL và NUMERIC MySQL.

class Customer {
private String _name;
private Vector _rentals = new Vector();
public Customer (String name){
_name = name;
}
public void addRental(Rental arg) {
_rentals.addElement(arg);
class Rental {
private Movie _movie;
private int _daysRented;
public Rental(Movie movie, int daysRented) {
_movie = movie;
_daysRented = daysRented;
}
public class Movie {
public static final int CHILDRENS = 2;
public static final int REGULAR = 0;
public static final int NEW_RELEASE = 1;
private String _title;
private int _priceCode;
public Movie(String title, int priceCode) {
_title = title;
public void testGetPageHierarchyAsXml() throws Exception {
givenPages("PageOne", "PageOne.ChildOne", "PageTwo");
whenRequestIsIssued("root", "type:pages");
thenResponseShouldBeXML();
}
public void testGetPageHierarchyHasRightTags() throws Exception {
givenPages("PageOne", "PageOne.ChildOne", "PageTwo");
whenRequestIsIssued("root", "type:pages");
thenResponseShouldContain(
"<name>PageOne</name>", "<name>PageTwo</name>", "<name>ChildOne</name>"