分类 Code 下的文章

Sqlite Basic Knowledge

  1. Date Types

    1. TEXT INTEGER NUMERIC REAL NONE

    2. String Datatypes -All string datatypes in SQLite are converted to a TEXT datatype. If you try to specify a size for a string datatype, SQLite will ignore it, as it does not allow size restrictions on string datatypes.

      展开阅读

Java Generic And Collection Basic

  1. 深入了解需要精读Java Generics and Collections

  2. 泛读材料40 Java Collections Interview Questions and Answers

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class ListTest {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();

        list.add("Robin");
        list.add("TianYa");
        list.add("Generic");
        
        //Three Way Iterator List
        System.out.println("***For Loop***");
        for (int i = 0; i < list.size(); i++) {
            System.out.println(list.get(i));
        }
        
        System.out.println("***Foreach Loop***");
        for (String n : list) {
            System.out.println(n);
        }
        
        System.out.println("***Iterator***");
        for (Iterator<String> it = list.iterator(); it.hasNext(); ) {
            System.out.println(it.next());
        }
        
        //List Reference Object
        List<Object> listObjcet = new ArrayList<>();
        
        listObjcet.add(new PersonInfo(1, "Robin", "Java"));
        listObjcet.add(new PersonInfo(2, "Tianya", "C++"));
        listObjcet.add(new PersonInfo(3, "Collection", "C"));

        System.out.println("***For Loop Object***");
        for (Iterator<Object> it = listObjcet.iterator(); it.hasNext(); ) {
            System.out.println(it.next());
        }
        
    }

}

展开阅读

jQuery Practical - Fundamental-I

jQuery Practical - Fundamental-I

  1. Using jQuery find all textareas, and makes a border. Then adds all paragraphs to the jQuery object to set their borders red. Go to the editor You can see the output from

    .addBorder {
           border: 2px solid red;
    }
    
    $("#button1").on("click",function() {
        if ($("textarea").hasClass("addBorder")) {
            $("textarea").removeClass("addBorder");
        } else {
            $("textarea").addClass("addBorder");
        } 
    });
    
  2. Set the background color red of the following elements using jQuery

    展开阅读