2019年 04月 11日 - js读取csv

    读取文件到网页

    <!DOCTYPE html>
    <html>
    <head>
    </head>
    <body>
    jsReadFile:<input type="file" onchange="jsReadFiles(this.files)"/>
    <button onclick="jsReadFiles();">read</button>
    </body>
    <script>
    //js 读取文件
    function jsReadFiles(files) {
        if (files.length) {
            var file = files[0];
            var reader = new FileReader();//new一个FileReader实例
            console.log('file.type:%o',file.type)
            if (/text+/.test(file.type)) {//判断文件类型,是不是text类型
                reader.onload = function() {
                    $('body').append('<pre>' + this.result + '</pre>');
                }
                reader.readAsText(file);
            } else if(/image+/.test(file.type)) {//判断文件是不是imgage类型
                reader.onload = function() {
                    $('body').append('<img src="' + this.result + '"/>');
                }
                reader.readAsDataURL(file);
            }
        }
    }
    </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.0/jquery.slim.js"></script>
    </html>
    

    2019年 04月 10日 - nodejs的安装

    安装

    1. 官网nodejs
    2. centOS:yum install nodejs
    3. mac:brew install node

    进阶操作

    • 使用n模块进行多版本管理,n(不支持Windows系统)
    • 使用nvm进行多版本管理,nvm

    2019年 04月 08日 - 踩坑日记之无参构造函数导致mysql类型转换异常

    问题描述

    查询数据库结果集设置失败,数据库字段为VARCHAR,Entity中映射的也是String,结果提示无法将XXX转换成Integer的异常

    关键词

    Cannot determine value type from string

    Invalid value for getInt()

    2019年 03月 16日 - 待整理文档

    平时遇到的问题/知识点

    • 脚本执行器,GroovyShell,GroovyClassLoader以及Java-Script引擎
    • SPI机制
    • mac下彻底删除pkg文件
    • windowns下代替cmd的linux命令工具cmder
    • Spring RestTemplate
    • graphql

    2019年 03月 05日 - linux下批量删除指定类型文件

    linux下批量删除指定类型文件

    find  . -name  '.DS_Store' -type  f -print -exec  rm -rf  {} \;