ctrl+c
[root@itv-api_php_bj_syq_10_70_62_28 /]#  ping -f xx.xx.xx.xx
PING xx.xx.xx.xx(10.78.72.163) 56(84) bytes of data.
...................................^C  (ctrl+c)
--- xx.xx.xx.xxping statistics ---
44364 packets transmitted, 44330 received, 0% packet loss, time 651113ms
rtt min/avg/max/mdev = 53.616/55.311/79.376/2.586 ms, pipe 7, ipg/ewma 14.676/54.124 ms


情况是这样的~本来是4M的线路需要增开到10M,客户测试的时候是在linux下用ping -f命令测试极限,发现带宽依旧只是4M。但采用feiQ这类局域网文件传输工具,两端的传输速度都能达到1.2MB/s以上。两端经过的是SDH传输网。 有没有大神能解释下linux ping-f这命令...

ping -f
尽可能快地发送报文

linux下 ping命令参数
表1 ping命令参数(linux)
参数
描述
-c count
在收发指定的count个数目的报文后停止
-d
在套接口设置so_debug
-f
尽可能快地发送报文
-i wait
设置连续报文发送时报文间的发送时间间隔(单位为秒)
-i ?device?
设置输出接口
-l preload
尽可能快地发送预载的报文,然后再返回到正常发送模式
-n
不查寻主机名,仅仅给出ip地址值
-p pattern
定义随同报文一起被发送的便笺内容(便笺最长为16个字节)
-q
仅输出结果的总结内容
-r
不使用路由表来发送报文,而是直接把报文发到主机
-r
设置记录路由选择功能,即记录报文传送经过的路径
-s packetsize
设置要发送的报文大小(单位为字节,最大长度是64k,缺省长度是64)
-t tsonly
发送一个带有时间戳的ping报文
-t tsandaddr
收集时间戳和地址
-t tsprespec
[host1 [host2 [host3 [host4]]]] 收集来自预定的网络段的时间戳和地址
-w timeout
指定等待每个响应的最长时间(单位是毫秒)


linux下测试ping包:
ping -q -c 100 -s 8100 10.70.7.108
[root@a ~]# ping -q -c 100 -s 8100 101.200.228.135
PING 101.200.228.135 (101.200.228.135) 8100(8128) bytes of data.

背景:在MySQL与PostgreSQL的对比中,PG的JSON格式支持优势总是不断被拿来比较。最主要是json这种东西在做一些物联网时用php结合很有用处。
========================真实实践成功如下所示AddTime:2016-12-4==================================
CREATE TABLE json_test(  
id INT,  
person_desc TEXT  
)ENGINE INNODB;  

INSERT INTO json_test VALUES (1,'
    {  
    "programmers": [{  
        "firstName": "Brett",  
        "lastName": "McLaughlin",  
        "email": "aaaa"  
    }, {  
        "firstName": "Jason",  
        "lastName": "Hunter",  
        "email": "bbbb"  
    }, {  
        "firstName": "Elliotte",  
        "lastName": "Harold",  
        "email": "cccc"  
    }],  
    "authors": [{  
        "firstName": "Isaac",  
        "lastName": "Asimov",  
        "genre": "sciencefiction"  
    }, {  
        "firstName": "Tad",  
        "lastName": "Williams",  
        "genre": "fantasy"  
    }, {  
        "firstName": "Frank",  
        "lastName": "Peretti",  
        "genre": "christianfiction"  
    }],  
    "musicians": [{  
        "firstName": "Eric",  
        "lastName": "Clapton",  
        "instrument": "guitar"  
    }, {  
        "firstName": "Sergei",  
        "lastName": "Rachmaninoff",  
        "instrument": "piano"  
    }]  
}');  

ALTER TABLE json_test MODIFY person_desc json;  



{
    "programmers":[
        {
            "firstName":"Brett",
            "lastName":"McLaughlin",
            "email":"aaaa"
        },
        {
            "firstName":"Jason",
            "lastName":"Hunter",
            "email":"bbbb"
        },
        {
            "firstName":"Elliotte",
            "lastName":"Harold",
            "email":"cccc"
        }
    ],
    "authors":[
        {
            "firstName":"Isaac",
            "lastName":"Asimov",
            "genre":"sciencefiction"
        },
        {
            "firstName":"Tad",
            "lastName":"Williams",
            "genre":"fantasy"
        },
        {
            "firstName":"Frank",
            "lastName":"Peretti",
            "genre":"christianfiction"
        }
    ],
    "musicians":[
        {
            "firstName":"Eric",
            "lastName":"Clapton",
            "instrument":"guitar"
        },
        {
            "firstName":"Sergei",
            "lastName":"Rachmaninoff",
            "instrument":"piano"
        }
    ]
}





mysql> SELECT id,json_keys(person_desc) as "keys" FROM json_test\G
*************************** 1. row ***************************
  id: 1
keys: ["authors", "musicians", "programmers"]
1 row in set (0.00 sec)


mysql>  SELECT json_extract(AUTHORS,'$.lastName[0]') AS 'name', AUTHORS FROM  
    ->     (  
    ->     SELECT id,json_extract(person_desc,'$.authors[0][0]') AS "authors" FROM json_test  
    ->     UNION ALL  
    ->     SELECT id,json_extract(person_desc,'$.authors[1][0]') AS "authors" FROM json_test  
    ->     UNION ALL  
    ->     SELECT id,json_extract(person_desc,'$.authors[2][0]') AS "authors" FROM json_test  
    ->     ) AS T1  
    ->     ORDER BY NAME DESC;
+------------+----------------------------------------------------------------------------+
| name       | AUTHORS                                                                    |
+------------+----------------------------------------------------------------------------+
| "Williams" | {"genre": "fantasy", "lastName": "Williams", "firstName": "Tad"}           |
| "Peretti"  | {"genre": "christianfiction", "lastName": "Peretti", "firstName": "Frank"} |
| "Asimov"   | {"genre": "sciencefiction", "lastName": "Asimov", "firstName": "Isaac"}    |
+------------+----------------------------------------------------------------------------+
3 rows in set (0.00 sec)



mysql> SELECT  
    -> json_extract(AUTHORS,'$.firstName[0]') AS "firstname",  
    -> json_extract(AUTHORS,'$.lastName[0]') AS "lastname",  
    -> json_extract(AUTHORS,'$.genre[0]') AS "genre"  
    -> FROM  
    -> (  
    -> SELECT id,json_extract(person_desc,'$.authors[0]') AS "authors" FROM json_test  
    -> ) AS T\G ;
*************************** 1. row ***************************
firstname: "Isaac"
lastname: "Asimov"
    genre: "sciencefiction"
1 row in set (0.00 sec)

修改的方法,注意加双引号:
mysql> update json_test set  person_desc=json_set(person_desc,"$.authors[2].firstName",'dong');
Query OK, 1 row affected (0.04 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT id,json_extract(person_desc,'$.authors[2].firstName') AS "authors" FROM json_test;
+------+---------+
| id   | authors |
+------+---------+
|    1 | "dong"  |
+------+---------+
1 row in set (0.00 sec)



自己设计一个Json串的字段:
  {  
    "deviceinfo": [{  
        "chineseName": "蛋壳孵化I型",  
        "EnglishName": "LevooAllCanBeHatch",  
        "deviceMacAdd": "00-50-56-C0-00-08"  
    }],  
    "tcpserverinfo": [{  
        "fd": "Isaac",  
        "connTime": "2014-11-11 23:45:21",  
        "connIp": "127.0.0.1"  
    }],  
    "websocketinfo": [{  
        "fd": "1",  
        "connTime": "2014-11-11 23:45:21",  
        "connIp": "127.0.0.1"  
    }, {  
        "fd": "21",  
        "connTime": "2014-11-11 23:45:21",  
        "connIp": "127.0.0.2"  
    }]  
}


mysql> update `json_test` set person_desc=json_set(person_desc, "$.deviceinfo[0].chineseName", '蛋壳108') where id=20;          
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0


mysql>  SELECT * FROM json_test where id=20\G;
*************************** 1. row ***************************
         id: 20
person_desc: {"deviceinfo": [{"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳108", "deviceMacAdd": "00-50-56-C0-00-08"}], "tcpserverinfo": [{"fd": "Isaac", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}], "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "21", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)




Json的格式更简单一些:
  {  
    "deviceinfo": {  
        "chineseName": "蛋壳孵化I型",  
        "EnglishName": "LevooAllCanBeHatch",  
        "deviceMacAdd": "00-50-56-C0-00-08"  
    },  
    "tcpserverinfo": {  
        "fd": "Isaac",  
        "connTime": "2014-11-11 23:45:21",  
        "connIp": "127.0.0.1"  
    },  
    "websocketinfo": [{  
        "fd": "1",  
        "connTime": "2014-11-11 23:45:21",  
        "connIp": "127.0.0.1"  
    }, {  
        "fd": "21",  
        "connTime": "2014-11-11 23:45:21",  
        "connIp": "127.0.0.2"  
    }]  
}
mysql> update `json_test` set person_desc=json_set(person_desc, "$.deviceinf.chineseName", '蛋壳108') where id=30;
Query OK, 0 rows affected (0.01 sec)
Rows matched: 1  Changed: 0  Warnings: 0


=================================================================================================================
mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳孵化I型", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "Isaac", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "21", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)

mysql> update `json_test` set person_desc=json_set(person_desc, "$.deviceinfo.chineseName", '蛋壳1081') where id=30;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳1081", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "Isaac", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "21", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)


=================================================================================================================
mysql> update `json_test` set person_desc=json_set(person_desc, "$.deviceinfo.chineseName", '蛋壳108109') where id=30;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳108109", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "Isaac", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "21", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)

===================================================================================================================
mysql> update `json_test` set person_desc=json_set(person_desc, "$.tcpserverinfo.fd", '蛋壳108109') where id=30;                      
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0



======================================================修改二级=====================================================
mysql> update `json_test` set person_desc=json_set(person_desc, "$.websocketinfo[1].fd", '22') where id=30;                                
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳108109", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "蛋壳108109", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "22", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)


=================================插入新的数组属性===================================
mysql> update `json_test` set person_desc=json_insert(person_desc, "$.websocketinfo[1].fdfd", '2222') where id=30;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳108109", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "蛋壳108109", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "22", "fdfd": "2222", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}


最后想了一下,那个websocket是没有啥用的,直接简单化即可:
{
    "deviceinfo":{
        "EnglishName":"LevooAllCanBeHatch",
        "chineseName":"蛋壳108109",
        "deviceMacAdd":"00-50-56-C0-00-08"
    },
    "tcpserverinfo":{
        "fd":"蛋壳108109",
        "connIp":"127.0.0.1",
        "connTime":"2014-11-11 23:45:21"
    },
    "websocketinfo":[
        {
            "fd":"1",
            "connIp":"127.0.0.1",
            "connTime":"2014-11-11 23:45:21"
        }
    ]
}



josn类不能有如下默认值:
{
    "deviceinfo":{
        "EnglishName":"N/A",
        "chineseName":"N/A",
        "deviceMacAdd":"N/A"
    },
    "tcpserverinfo":{
        "fd":"N/A",
        "connIp":"N/A",
        "connTime":"N/A"
    },
    "websocketinfo":[
        {
            "fd":"N/A",
            "connIp":"N/A",
            "connTime":"N/A"
        }
    ]
}



php json.php
{
    "deviceinfo":{
        "EnglishName":"N/A",
        "chineseName":"N/A",
        "deviceMacAdd":"N/A"
    },
    "tcpserverinfo":{
        "fd":"N/A",
        "connIp":"N/A",
        "connTime":"N/A"
    },
    "websocketinfo":[
        {
            "fd":"N/A",
            "connIp":"N/A",
            "connTime":"N/A"
        }
    ]
}Array
(
    [deviceinfo] => Array
        (
            [EnglishName] => N/A
            [chineseName] => N/A
            [deviceMacAdd] => N/A
        )

    [tcpserverinfo] => Array
        (
            [fd] => N/A
            [connIp] => N/A
            [connTime] => N/A
        )

    [websocketinfo] => Array
        (
            [0] => Array
                (
                    [fd] => N/A
                    [connIp] => N/A
                    [connTime] => N/A
                )

        )

)



mysql> select json_extract(data,'$.tcpserverinfo.fd') as fd from hatch_dev_temp where hatchdevid=1;
+----------------+
| fd             |
+----------------+
| "蛋壳108109"   |
+----------------+
1 row in set (0.00 sec)


=============================================================================================
mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳孵化I型", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "Isaac", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "21", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)

mysql> update `json_test` set person_desc=json_set(person_desc, "$.deviceinfo.chineseName", '蛋壳1081') where id=30;
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳1081", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "Isaac", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "21", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)


=============================================================================================
mysql> update `json_test` set person_desc=json_set(person_desc, "$.deviceinfo.chineseName", '蛋壳108109') where id=30;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳108109", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "Isaac", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "21", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)

===================================================================================================================
mysql> update `json_test` set person_desc=json_set(person_desc, "$.tcpserverinfo.fd", '蛋壳108109') where id=30;                      
Query OK, 1 row affected (0.02 sec)
Rows matched: 1  Changed: 1  Warnings: 0



======================================================修改二级=====================================================
mysql> update `json_test` set person_desc=json_set(person_desc, "$.websocketinfo[1].fd", '22') where id=30;                                
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳108109", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "蛋壳108109", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "22", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}
1 row in set (0.00 sec)


=================================插入新的数组属性===================================
mysql> update `json_test` set person_desc=json_insert(person_desc, "$.websocketinfo[1].fdfd", '2222') where id=30;
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> SELECT * FROM json_test where id=30\G;
*************************** 1. row ***************************
         id: 30
person_desc: {"deviceinfo": {"EnglishName": "LevooAllCanBeHatch", "chineseName": "蛋壳108109", "deviceMacAdd": "00-50-56-C0-00-08"}, "tcpserverinfo": {"fd": "蛋壳108109", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, "websocketinfo": [{"fd": "1", "connIp": "127.0.0.1", "connTime": "2014-11-11 23:45:21"}, {"fd": "22", "fdfd": "2222", "connIp": "127.0.0.2", "connTime": "2014-11-11 23:45:21"}]}


最后想了一下,那个websocket是没有啥用的,直接简单化即可:
{
    "deviceinfo":{
        "EnglishName":"LevooAllCanBeHatch",
        "chineseName":"蛋壳108109",
        "deviceMacAdd":"00-50-56-C0-00-08"
    },
    "tcpserverinfo":{
        "fd":"蛋壳108109",
        "connIp":"127.0.0.1",
        "connTime":"2014-11-11 23:45:21"
    },
    "websocketinfo":[
        {
            "fd":"1",
            "connIp":"127.0.0.1",
            "connTime":"2014-11-11 23:45:21"
        }
    ]
}



josn类不能有如下默认值:
{
    "deviceinfo":{
        "EnglishName":"N/A",
        "chineseName":"N/A",
        "deviceMacAdd":"N/A"
    },
    "tcpserverinfo":{
        "fd":"N/A",
        "connIp":"N/A",
        "connTime":"N/A"
    },
    "websocketinfo":[
        {
            "fd":"N/A",
            "connIp":"N/A",
            "connTime":"N/A"
        }
    ]
}

修改tcpserver里的fd的句柄及查询该句柄的值:
mysql> update hatch_dev_temp set data=json_set(data, "$.tcpserverinfo.fd", '108') where hatchdevid=1;                                
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select json_extract(data,'$.tcpserverinfo.fd') as fd from hatch_dev_temp where hatchdevid=1;    
+-------+
| fd    |
+-------+
| "108" |
+-------+
1 row in set (0.00 sec)

mysql> update hatch_dev_temp set data=json_set(data,"$.tcpserverinfo.fd",22) where hatchdevid=1;    
Query OK, 1 row affected (0.01 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql>  select json_extract(data,'$.tcpserverinfo.fd') as fd from hatch_dev_temp where hatchdevid=1;  
+------+
| fd   |
+------+
| 22   |
+------+
1 row in set (0.00 sec)


EOF
========================================================================================


修改json数据:
JSON_SET(json_doc, path, val[, path, val] ...)
修改数据

update t set js=json_set('{"a":1,"s":"abc"}','$.a',456,'$.b','bbb') where id=1

结果js={"a":456,"s":"abc","b":"bbb"}

path中$就代表整个doc,然后可以用javascript的方式指定对象属性或者数组下标等.
执行效果,类似json的语法
$.a=456
$.b="bbb"

存在就修改,不存在就设置.

$.c.c=123
这个在javascript中会出错,因为.c为null。
但是在json_set('{}','$.c.c',123)中,不存在的路径将直接被忽略。
来自:http://blog.5ibc.net/p/36344.html
http://jackyrong.iteye.com/blog/2282003
多唯json数组的修改处理方法:
http://blog.csdn.net/yueliangdao0608/article/details/49760213


MySQL 5.7.7 labs版本开始InnoDB存储引擎已经原生支持JSON格式,该格式不是简单的BLOB类似的替换。原生的JSON格式支持有以下的优势:
JSON数据有效性检查:BLOB类型无法在数据库层做这样的约束性检查
查询性能的提升:查询不需要遍历所有字符串才能找到数据
支持索引:通过虚拟列的功能可以对JSON中的部分数据进行索引


来自:http://database.51cto.com/art/201504/472302.htm


-------------------------------------------------------------------------------------------------------------------------
MySQL 5.7原生JSON格式支持:


可以看到我们新建了表user,并且将列data定义为了JSON类型。这意味着我们可以对插入的数据做JSON格式检查,确保其符合JSON格式的约束,如插入一条不合法的JSON数据会报如下错误:
mysql> insert into user values (NULL,"test");
ERROR 3130 (22032): Invalid JSON text: "Invalid value" at position 2 in value (or column) 'test'.
此外,正如前面所说的,MySQL 5.7提供了一系列函数来高效地处理JSON字符,而不是需要遍历所有字符来查找,这不得不说是对MariaDB dynamic column的巨大改进:

当然,最令人的激动的功能应该是MySQL 5.7的虚拟列功能,通过传统的B+树索引即可实现对JSON格式部分属性的快速查询。使用方法是首先创建该虚拟列,然后在该虚拟列上创建索引:

然后可以通过添加的索引对用户名进行快速的查询,这和普通类型的列查询一样。而通过explain可以验证优化器已经选择了在虚拟列上创建的新索引:
mysql> explain select * from user where user_name='"Amy"'\G
*************************** 1. row ***************************
           id: 1
  select_type: SIMPLE
        table: user
   partitions: NULL
         type: ref
possible_keys: idx_username
          key: idx_username
      key_len: 131
          ref: const
         rows: 1
     filtered: 100.00
        Extra: NULL
1 row in set, 1 warning (0.00 sec)
可以发现MySQL 5.7对于JSON格式堪称完美

摘自:http://www.innomysql.net/article/15319.html



修改json地址:
mysql> set @json='["apple", {"attr": [50, true], "name": "orange"}]';
Query OK, 0 rows affected (0.00 sec)

mysql> select json_insert(@json, '$[1].attr[0]', 2, '$[2]', "pear");
+-----------------------------------------------------------+
| json_insert(@json, '$[1].attr[0]', 2, '$[2]', "pear")     |
+-----------------------------------------------------------+
| ["apple", {"attr": [50, true], "name": "orange"}, "pear"] |
+-----------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select json_replace(@json, '$[1].attr[0]', 2, '$[2]', "pear");
+--------------------------------------------------------+
| json_replace(@json, '$[1].attr[0]', 2, '$[2]', "pear") |
+--------------------------------------------------------+
| ["apple", {"attr": [2, true], "name": "orange"}]       |
+--------------------------------------------------------+
1 row in set (0.00 sec)

mysql>  select json_set(@json, '$[1].attr[0]', 2, '$[2]', "pear");
+----------------------------------------------------------+
| json_set(@json, '$[1].attr[0]', 2, '$[2]', "pear")       |
+----------------------------------------------------------+
| ["apple", {"attr": [2, true], "name": "orange"}, "pear"] |
+----------------------------------------------------------+
1 row in set (0.01 sec)

mysql> select json_remove(@json, '$[1].attr[0]', '$[2]');
+-----------------------------------------------+
| json_remove(@json, '$[1].attr[0]', '$[2]')    |
+-----------------------------------------------+
| ["apple", {"attr": [true], "name": "orange"}] |
+-----------------------------------------------+
1 row in set (0.00 sec)
您查询的IP:121.35.46.0
本站数据:广东省深圳市 电信
参考数据1:广东深圳 电信
参考数据2:广东省深圳市 电信
download
C:\Users\admin>ping 121.35.46.0 -t

正在 Ping 121.35.46.0 具有 32 字节的数据:
来自 121.35.46.0 的回复: 字节=32 时间=60ms TTL=52
来自 121.35.46.0 的回复: 字节=32 时间=58ms TTL=52
来自 121.35.46.0 的回复: 字节=32 时间=58ms TTL=52
来自 121.35.46.0 的回复: 字节=32 时间=59ms TTL=52

Linux:
ping 10.78.72.90
ping -s 1500 -c 10 -a 10.70.39.254 10.78.72.90

10 packet(s) transmitted
10 packet(s) received
0.00% packet loss
round-trip min/avg/max = 111/111/113 ms

根据1秒=1000毫秒,也就是说111ms = 0.111s/一个包,那么10个1秒,60秒一分钟也就是10X60=600个包左右。
(应用工程师反映:循环写队列每秒仅12条,刚好相符合,得到验证。)
如何定义网络延迟程度:
  (网络延迟PING值越低速度越快)
  1~30ms:极快,几乎察觉不出有延迟,玩任何游戏速度都特别顺畅
  31~50ms:良好,可以正常游戏,没有明显的延迟情况
  51~100ms:普通,对抗类游戏能感觉出明显延迟,稍有停顿
  >100ms:差,无法正常游戏,有卡顿,丢包并掉线现象
  计算方法:1秒=1000毫秒(例:30ms为0.03秒)

摘自:http://www.jb51.net/network/61196.html
摘自华仔的黑夜路人 2016-11-16 黑夜路人 黑夜路人技术
1.今天这个话题我推荐个电子书, 嗯嗯, MySQL 官方的   mysql internals manual   另外就是姜神两本书, 结合起来看我觉得最好   毕竟姜神只是将了实现原理, 具体如何看源码却没有讲    --我不叫大脸猫

2.看 MYSQL得先看懂C++吧  --阿杜

3.InnoDB引擎是以C为主开发的 --我不叫大脸猫

4.看看redis的源码还行,压力不大,mysql的太难了,下不了爪    --孔乙己

5.对于普通人来讲,读mysql源码性价比略低,redis、nginx、php都可以先试读一下  --liyang

6.mysql 源码在lnmp架构中最难了,可以先从php 源码入手,然后redis   --taxuewuhen

7.先把mysql 内核原理看一遍,然后分模块分析源码  --秋天

8.可以从innodb读起  MySQL其实不是难度太大,就是比较杂,乱七八糟的很多  --廖强

9.innodb 技术含量蛮高的。  读明白了,大部分数据库、存储的问题都理解了。  --黑夜路人

10.最好一个功能点,比如主从同步等,通过gdb定位来阅读会好很多,其实也不复杂  --廖强

11.强哥用gdb -p还是用别的gdb方式阅读?  --周志

12.不是用gdb阅读,是用gdb找到对应代码处理的地方,针对性的看,可以忽略很多无关的东西  --廖强

13.一般用gdb我都找不到自己想要找的对应代码的位置,我就用gdb -p的,强哥一般用啥?  --周志

14.你别-p啊  自己重新编译,编译参数加上-g  --廖强

15.比如我看redis源码,直接gdb redis-cli   --周志

16.类似啊,直接启跟attach到进城上去差不多,但是必须加上-g参数编译  如果一开始就不知道入口在哪里,可以先info files,找到Entry point的地址,再b *地址,就可以看到入口文件了  --廖强

17.找到了,也给redis-cli添加了断点  想调试下这个函数sdssplitargs,我该怎么找到它呢  --周志

18.直接b函数名  --廖强



【链接】
MySQL · 源码分析 · 网络通信模块浅析
http://mp.weixin.qq.com/s?__biz=MzAwNjQwNzU2NQ==&mid=2650342817&idx=1&sn=bda66b2940d7fe20dfa881a1dd8b55ed&mpshare=1&scene=1&srcid=1115GFLqgSWVdbSTDVYWntAf#rd

淘宝Buy+负责人胡晓航谈干货:我们碰到了哪些“坑”?
http://media.weibo.cn/article?featurecode=20000180&from=timeline&id=2309404041700417887341&jumpfrom=weibocom&lfid=4015325827391301&luicode=10000370&oid=3678257112902716&sourceType=weixin

服务容错模式
http://mp.weixin.qq.com/s?__biz=MjM5NjQ5MTI5OA==&mid=2651745508&idx=2&sn=73f76b6462f521374fb548c21386467e&chksm=bd12b5a98a653cbf829ea3558e3a7f1d90d7986717b439b9a6bfe9ec011861bd62a4fa103dd2&mpshare=1&scene=1&srcid=1114PCSc5RrYgRDtIImUYoKJ#rd

Hystrix 使用与分析
http://m.blog.csdn.net/article/details?id=50000511

又一个升级到PHP 7后性能提升50%的案例:Tumblr
http://mp.weixin.qq.com/s?__biz=MzAwMDU1MTE1OQ==&mid=2653547882&idx=1&sn=12512269ddb4743c6c7978277643d28b&chksm=813a7cf2b64df5e406ad8ebee973da19d330b3785a134af577883e5f725fa28884d070ed9cf7&mpshare=1&scene=1&srcid=1115vhT3jmCZQ5qd7jtLKtf6#wechat_redirect

【揭秘】腾讯大数据98.8秒完成100TB数据排序的架构和算法
http://mp.weixin.qq.com/s?__biz=MzA3MDQ4MzQzMg==&mid=2665690467&idx=1&sn=9c7c37541ea9a0f6f6709133ac569888&chksm=842bb9e4b35c30f20d2f83070536e411f00c7b8e125f13db1c8f9081b3006ffa84f15cc7dcf1&mpshare=1&scene=1&srcid=11159tGabp6p0vqT5lXdZye4#rd
win8.1出现 called runscript when not marked in progress

1.打开任务管理器-详细信息-结束图片中选择的进程
exporer --》windows资源管理器。


2.然后在任务管理器左上角“文件“=>运行新任务:
要在资源管理器里运行,否则如果点win+R是没有以管理员权限创建此任务的勾选项的。


输入C:\\Windows\explorer.exe,并勾选”以系统管理权限创建此任务“,点击确定:

3.这样就可以继续安装了。



来自:http://www.cnblogs.com/mumuhuozaimengli/p/3984203.html
注意是在关机选项,在右侧双击“关闭会阻止或取消关机的应用程序的自动终止功能”。

关机出现关闭程序提示框

运行输入Gpedit.msc回车打开组策略,在左侧选计算机配置/管理模板/系统/关机选项,在右侧双击“关闭会阻止或取消关机的应用程序的自动终止功能”,在打开的提示框中选“已启用”,按确定即可。


来自:https://zhidao.baidu.com/question/1885611222821573148.html
PS:
C记录是啥?cdn的域名, cname.补俩CDN源站。

阅读全文
[coses=php]

echo "JACK"|tr A-Z a-z
jack
[/codes]

~          将光标下的字母改变大小写,这个相当有用,因为咱们类首字母大写,而后对象则是首字母小写,在对象后加上Obj,如:


======================================================================
~          将光标下的字母改变大小写

3~         将光标位置开始的3个字母改变其大小写

g~~        改变当前行字母的大小写

U          将可视模式下选择的字母全改成大写字母

u          将可视模式下选择的字母全改成小写

gUU        将当前行的字母改成大写

3gUU       将从光标开始到下面3行字母改成大写

guu       将当前行的字母全改成小写

gUw       将光标下的单词改成大写。

guw       将光标下的单词改成小写。


来自:http://blog.chinaunix.net/uid-22606185-id-3373942.html
背景:PHP5.5 在centos6 64位下编译报错,之前在另一台rpmbuild机上不存在这个问题。


解决办法:

vim /etc/ld.so.conf.d/local.conf     # 编辑库文件
/usr/local/lib                       # 添加该行
:wq                                  # 保存退出
ldconfig -v                          # 使之生效

注意事项:
这里添加的库文件路径一定要和你系统平台arch一致,32bit的系统直接添加/usr/local/lib即可,64bit系统要填加/usr/local/lib64.否则依旧会报错,我当时就是添加了/usr/local/lib死活编辑不了,后来更改为
/usr/local/lib64才可以。切记

http://lovelace.blog.51cto.com/1028430/1314571
已解决,问题出在lenovo_mouse_suite这个软件上,最新版的661有问题,卸载,最后安装650版本的,完美解决问题!

来自:http://forum.51nb.com/thread-1316997-1-1.html

在:
http://support1.lenovo.com.cn/lenovo/wsi/Modules/Drive.aspx?intcmp=I_F_Driver
里下载:
http://driverdl.lenovo.com.cn/lenovo/DriverFilesUploadFloder/42226/LenovoDM_Setup.exe
背景:升级后出现修改成unix的换行变成了windows的\r\n了。
  文件的格式控制可以Perference->Setting-*中找到。设置对象是default_line_ending,这个参数有三 个可用选
项:system,windows,unix,system是根据当前系统情况设置,windows使用的CRLF,unix使用的是 LF。按你的情况,应该在Setting-User中设置"default_line_ending":"unix"就可以解决这个问题。





二:Sublime列选择和Editplus的区别:
1)Editplus是alt+鼠标左键。
2)Sublime是Shift+鼠标右键。
  云计算可以帮助企业降低IT方面的成本和复杂性,并获得他们蓬勃发展所需的灵活性与敏捷性。但是,规划出通往云的明确路径并非易事。毕竟用户需要看透与云相关的市场大肆宣传,然后理解并分析不同种类的云计算模式的优点与缺点。此外,还需要确定备选的云中哪些最适合自己企业的战略、工作负载、性能、安全性需求和内部IT的专业知识,甚至希望将来某一刻可以完全地“Do it yourself“(自己动手)。

      本文将介绍“云“服务的三种类型,并讨论不同云计算模式满足什么类型的需要。

什么是云计算?

      云计算使用户能够通过Internet或专用网络访问软件、服务器、存储以及其他计算资源。这些资源与位置无关,具体表现在用户通常不需要管理甚至了解这些资源的实际位置。用户根据需要购买和使用IT资源,并根据使用量为其使用的服务付费。

      云计算构建在虚拟化技术的基础上,而虚拟化技术提供从弹性资源池中调配IT服务的功能。虚拟化可以将一个物理机分区为多个虚拟机,其中每一个虚拟机都可以独立与其他设备、应用程序、数据和用户交互,就像它是独立的物理资源一样。不同的虚拟机可以运行不同的操作系统和多种应用程序,同时共享单个物理计算机上的资源。因为每个虚拟机与其他虚拟机隔离,如果一个虚拟机崩溃,其他的不会受影响。除了使用虚拟化技术将一个计算机分区为多个虚拟机外,还可以使用虚拟化技术将多个物理资源合并为单个虚拟资源。存储虚拟化就是一个最好的例子:在此情况下,多个网络存储资源池化显示为单个存储设备,以实现对存储资源更轻松高效的利用和管理。

      虚拟机管理程序软件使虚拟化成为可能。这种软件也称为虚拟化管理器,位于硬件与操作系统之间,并使操作系统和应用程序与硬件隔离。虚拟机管理程序向操作系统和应用程序分配它们对处理器和其他硬件资源(例如内存和存储系统)所需的访问量。云提供商使用与他们提供的服务类型(存储、计算、带宽、有效用户帐户等)相关的计量功能来管理和优化资源。

云服务的常见类型:

      企业可以从数量不断增加的基于云的IT服务中进行选择和使用,并在不同类型的环境中部署它们。以下是三类最常见的“IT即服务”云产品:

软件即服务 (SaaS,Software as a Service) 使用户可以通过 Internet 访问软件应用程序。用户不必购买并在自己的计算机或设备上安装、更新和管理这些资源,而可以通过Web 浏览器访问并使用它们。SaaS 提供商在云中为用户管理软件、处理能力和存储。大多数 SaaS 解决方案在公共云中运行(详见下文),并以订阅或免费服务的形式提供。常用 SaaS应用程序的例子包括按需业务应用程序,例如 Salesforce.com、Google Apps for Business 和 SAP SuccessFactors,以及免费的社交网络解决方案,例如 LinkedIn 和 Twitter。
平台即服务 (PaaS,Platform as a Service) 提供在集成式云环境中开发、测试、运行和管理 SaaS 应用程序所需的基础架构和计算资源。拥有 Internet 连接的任何人都可以参与并开发基于云的解决方案,而不必寻找、购买和管理硬件、操作系统、数据库、中间件以及其他软件。大多数PaaS 供应商都可以提供比传统编程工具更易于使用的JavaScript、Adobe Flex 和 Flash 等工具。用户不必拥有或控制开发环境,但却能真正地控制他们在其中开发和部署的应用程序。一些知名度较高的 PaaS 提供商包括 Google App Engine、Windows Azure 和 Salesforce。
基础架构即服务 (IaaS,Infrastructure as a Service) 提供托管的 IT 基础架构,供用户调配处理能力、存储、网络和其他基础计算资源。IaaS 提供商运行并管理此基础架构,用户可以在此基础架构上运行选择的操作系统和应用程序软件。IaaS 提供商的例子有 Amazon Elastic Compute Cloud (EC2)、VerizonTerremark和 Google Compute Engine。
背景:rpmbuild时有一个make常常是这样写的,  make  DESTDIR=%{buildroot}  install,百这个buildroot是打包的路径,为何每次这样写都能奏效呢?是因为GUN的Make中约定俗成了的,如下。
     GNU Make中,有许多约定俗成的东西,比如这个DESTDIR:用于加在要安装的文件路径前的一个前缀变量。
比如,我们本地编译了一个第三方库,但需要对其打包发布给其他人使用,一方面如果我们安装到默认目录,比如/usr,这时,安装后的文件一但数量很大,则打包时很难找全;或者我们在configure时指定了--prefix,或cmake时指定了CMAKE_INSTALL_PREFIX,则pc文件内的编译依赖关系又会出错,变成了我们指定的那个路径,使用起来会很不方便。此时,DESTDIR就会派上用场。
DESTDIR只在make install时起作用,且和Makefile是由什么工具生成的没有关系,用法如下:
make install DESTDIR=<$CUSTOM_PREFIX>
在configure或cmake时,指定了要安装的路径后,以这种方式make install安装的文件会通通安装到以$CUSTOM_PREFIX为前缀的目录中,这样,开发者直接对这目录中的文件打包,即可发布使用。

来自:http://blog.csdn.net/coroutines/article/details/40891089
DownLoad:https://github.com/openresty/set-misc-nginx-module/
    最近公司运营提出需求,需要使从公司网站上下载的资料文件显示为中文名称,研发部问道我们有没有好的实现方法,php应该有这样的功能,研发回复说,之前就是这样实现过,但太消耗内存,不做考虑了,才有现在下载资料文件,显示中文名称没有实现。想了想,记起前段时间看agentzh(章亦春)大牛关于nginx的大作以及他写的nginx的模块,似乎有实现此类功能的模块,找了一下果然有:http://wiki.nginx.org/HttpSetMiscModule#Installation
利用其中 set_decode_base64 以及nginx 的 add_header 添加一个http头:Content-Disposition ,配合php代码实现。
nginx 添加模块重新编译
下载需要的模块:
到 https://github.com/agentzh/ 下载模块
agentzh-echo-nginx-module-v0.41-1-gb3ad5c1.tar.gz
agentzh-set-misc-nginx-module-v0.22rc8-5-ge79e7f0.tar.gz
simpl-ngx_devel_kit-v0.2.17-10-g4192ba6.tar.gz
解压到对应目录
安装:
./configure  --user=www --group=www --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --add-module=/usr/local/nginx_module/ngx_devel_kit --add-module=/usr/local/nginx_module/misc-nginx --add-module=/usr/local/nginx_module/echo-nginx

make -j2

make install
php 实现部分我也不是太懂,就不贴出来了。
nginx 相关配置段
点击在新窗口中浏览此图片
最终效果,上图
点击在新窗口中浏览此图片

各位童鞋注意啦:该种方式在使用CDN的网站中也可以生效的。
从该功能上线以来看,效果还不错,agentzh(章亦春)写的nginx模块那是杠杠的
参考:http://wiki.nginx.org/HttpSetMiscModule#Installation
来自:http://longzhiyi.blog.51cto.com/350171/964677
redis非授权访问的查毒过程,redis对外开端口时小心,或不要对外开端口:
http://lee90.blog.51cto.com/10414478/1857073
背景:有时在删除一些如ghost文件生成的~1这样的文件夹时,会提示没有权限,什么原因呢:1)是因为你不是administrator运行,也就不是最高权限在运行。2)这个文件夹是在之前重装系统时你有权的,但是后来重装后同样的用户Users但是uid不一样(姑且这样说),linux上有这个问题,估计windows下也有这个问题。

一)
怎么办呢?
就是在目录上加上当前用户Users的权限后,再删除就Ok了。

二)
怎么加呢?
(1)在目录上点右键后属性。
(2)点选安全后,在右下角点高级。
(3)点添加出来一个界面后,点主体[选择主体]。
(4)选择主体弹出来一个框里面,再点高级(A)...
(5)立即查找,找到Users,双击后添加进去点确定。
(6)回到点主体[选择主体]这个框里发现有Users这个用户了。下面有基本权限,咱勾选上【V】完全控制,点确认。
(7)于是在权限条目下面多了一个Users用户,且是完全控制的,完全控制也就是拥有所有对目录操作的权限,点确定才真的加上了,否则还是没加上哟。


这些步骤,做后,咱也就可以正常删除该目录了。

上面步骤涉及图片截图方面参考链接:http://jingyan.baidu.com/article/afd8f4de9fd3d634e386e950.html
背景:win10一堆无用的东西,在PC这块儿,得删除掉。
卸载预安装应用的方法就是你在开始菜单中输入“P”字母,系统就会自动反馈回“Windows PowerShell”应用程序,然后右键点击“以管理员身份运行”,会跳出蓝色的批处理界面,随后根据你的个人需求,输入相应的代码就能够轻松完成 Windows 10预安装应用的卸载工作。
From:http://www.111cn.net/sys/361/91862.htm

分页: 33/272 第一页 上页 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 下页 最后页 [ 显示模式: 摘要 | 列表 ]