xlcoder166 发布的文章

Vue&Axios Practice

Vue&Axios Practice

  1. Vue Practice

  2. Axios


1. HTML Code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="keywords" content="">
    <meta name="description" content="">
    
    <title>The NYT API Demo</title>
    <link rel="stylesheet" href="css/bootstrap.css">
    <link rel="stylesheet" href="css/main.css">

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
      <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
      <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body>
    <div id="app" class="container">
        <h3 class="text-center" >Vue News</h3>
            <div class="row">
                <div class="col-md-6">
                    <select id="" name="" v-model="section">
                        <option v-for="section in sections " :value="section" v-text="section"></option>
                    </select>
                </div>
                <div class="col-md-6">
                    <a class="btn btn-primary" @click="getPosts(section)">Chocie Category</a>
                </div>
            </div>

            <news-list :results="results"></news-list>
    </div>

    <script src="https://cdn.bootcss.com/vue/2.4.2/vue.js"></script>
    <script src="../bower_vendor/jquery/jquery.min.js"></script>
    <script src="../bower_vendor/axios/dist/axios.min.js"></script>
    <script src="./js/vue_fetchapi.js"></script>
</body>
</html>

展开阅读

Responsive Image Fundamentals

Responsive Image Fundamentals

  1. Article Point

  2. Reference

1. Article Point

  1. For photos and other raster images, the techniques you use might vary a bit, depending on if the images are loaded through CSS or HTML.

    展开阅读

PHP Use While instead of fetchAll

PHP Use While instead of fetchAll

PDOStatement::fetchAll() returns an array that consists of all the rows returned by the query. From this fact we can make two conclusions:

  1. This function should not be used, if many rows has been selected. In such a case conventional while loop ave to be used, fetching rows one by one instead of getting them all into array at once. "Many" means more than it is suitable to be shown on the average web page.

  2. This function is mostly useful in a modern web application that never outputs data right away during fetching, but rather passes it to template.

    展开阅读

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());
        }
        
    }

}

展开阅读